diff --git a/dao/dao_test.go b/dao/dao_test.go index 07551e252..265e1753b 100644 --- a/dao/dao_test.go +++ b/dao/dao_test.go @@ -725,6 +725,16 @@ func TestChangeUserProfile(t *testing.T) { } } +func TestGetRecentLogs(t *testing.T) { + logs, err := GetRecentLogs(currentUser.UserID, 10, "2016-05-13 00:00:00", time.Now().String()) + if err != nil { + t.Errorf("error occured in getting recent logs, error: %v", err) + } + if len(logs) <= 0 { + t.Errorf("get logs error, expected: %d, actual: %d", 1, len(logs)) + } +} + func TestDeleteUser(t *testing.T) { err := DeleteUser(currentUser.UserID) if err != nil { @@ -739,16 +749,6 @@ func TestDeleteUser(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, error: %v", err) - } - if len(logs) <= 0 { - t.Errorf("get logs error, expected: %d, actual: %d", 1, len(logs)) - } -} - func TestGetOrmer(t *testing.T) { o := GetOrmer() if o == nil { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index dbc64a853..3005b776e 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -671,9 +671,9 @@ paths: description: Unexpected internal errors. /logs: get: - summary: Get recent logs in the Harbor + summary: Get recent logs relevant to the user in Harbor description: | - This endpoint let user see the recent operation logs in the Harbor + This endpoint let user see his recent operation logs in Harbor parameters: - name: lines in: query @@ -685,13 +685,13 @@ paths: in: query type: string format: date - required: true + required: false description: The start time of the logs to be shown - name: end_time in: query type: string format: date - required: true + required: false description: The end time of the logs to be shown tags: - Products