modify code as travis ci required

This commit is contained in:
wemeya 2016-05-20 17:03:50 +08:00
parent 7c74b16eef
commit 888604fb0d
3 changed files with 5 additions and 4 deletions

View File

@ -22,6 +22,7 @@ import (
"github.com/vmware/harbor/utils/log"
)
//LogAPi handles request api/logs
type LogAPI struct {
BaseAPI
userID int

View File

@ -119,11 +119,11 @@ func AccessLog(username, projectName, repoName, repoTag, action string) error {
}
//GetRecentLogs returns recent logs according to parameters
func GetRecentLogs(lines int, start_time, end_time string) ([]models.AccessLog, error) {
func GetRecentLogs(lines int, startTime, endTime string) ([]models.AccessLog, error) {
var recentLogList []models.AccessLog
queryParam := make([]interface{}, 1)
queryParam = append(queryParam, start_time)
queryParam = append(queryParam, end_time)
queryParam = append(queryParam, startTime)
queryParam = append(queryParam, endTime)
qb, _ := orm.NewQueryBuilder("mysql")
qb.Select("log_id",
"user_id", "project_id", "repo_name", "repo_tag", "GUID", "operation", "op_time").

View File

@ -736,7 +736,7 @@ func TestChangeUserProfile(t *testing.T) {
t.Errorf("user email does not update, expected: %s, acutal: %s", "Unit Test", loginedUser.Email)
}
}
func GetRecentLogs(t *testing.T) {
func TestGetRecentLogs(t *testing.T) {
logs, err := GetRecentLogs(10, "2016-05-13 00:00:00", time.Now().String())
if err != nil {
t.Errorf("error occured in getting recent logs", err)