This commit is contained in:
Wenkai Yin 2017-06-09 17:01:56 +08:00
parent 20cf8de0f7
commit 6b4ae098db
4 changed files with 17 additions and 17 deletions

View File

@ -342,12 +342,13 @@ func (a testapi) ProjectsGet(query *apilib.ProjectQuery, authInfo ...usrInfo) (i
if len(authInfo) > 0 {
httpStatusCode, body, err = request(_sling, jsonAcceptHeader, authInfo[0])
} else {
log.Println("enter no auth $$$$$$$$$$$$$$$$$$$")
httpStatusCode, body, err = request(_sling, jsonAcceptHeader)
}
if err == nil && httpStatusCode == 200 {
err = json.Unmarshal(body, &successPayload)
} else {
log.Println(string(body))
}
return httpStatusCode, successPayload, err

View File

@ -82,7 +82,6 @@ func TestLogGet(t *testing.T) {
assert.Equal(int(200), httpStatusCode, "httpStatusCode should be 200")
addProjectID = projects[0].ProjectId
}
t.Logf("%%%%%%%%%%%%% %v", projects)
//delete the project
projectID := strconv.Itoa(int(addProjectID))

View File

@ -23,12 +23,12 @@
package apilib
type LogQuery struct {
Username string `json:"username"`
Repository string `json:"repository"`
Tag string `json:"tag"`
Operation []string `json:"operation"`
BeginTimestamp int64 `json:"begin_timestamp"`
EndTimestamp int64 `json:"end_timestamp"`
Page int64 `json:"page"`
PageSize int64 `json:"page_size"`
Username string `url:"username,omitempty"`
Repository string `url:"repository,omitempty"`
Tag string `url:"tag,omitempty"`
Operation []string `url:"operation,omitempty"`
BeginTimestamp int64 `url:"begin_timestamp,omitempty"`
EndTimestamp int64 `url:"end_timestamp,omitempty"`
Page int64 `url:"page,omitempty"`
PageSize int64 `url:"page_size,omitempty"`
}

View File

@ -59,11 +59,11 @@ type Project struct {
}
type ProjectQuery struct {
Name string `json:"name"`
Owner string `json:"owner"`
Public bool `json:"public"`
Member string `json:"member"`
Role int `json:"role"`
Page int64 `json:"page"`
PageSize int64 `json:"page_size"`
Name string `url:"name,omitempty"`
Owner string `url:"owner,omitempty"`
Public bool `url:"public,omitempty"`
Member string `url:"member,omitempty"`
Role int `url:"role,omitempty"`
Page int64 `url:"page,omitempty"`
PageSize int64 `url:"page_size,omitempty"`
}