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 { if len(authInfo) > 0 {
httpStatusCode, body, err = request(_sling, jsonAcceptHeader, authInfo[0]) httpStatusCode, body, err = request(_sling, jsonAcceptHeader, authInfo[0])
} else { } else {
log.Println("enter no auth $$$$$$$$$$$$$$$$$$$")
httpStatusCode, body, err = request(_sling, jsonAcceptHeader) httpStatusCode, body, err = request(_sling, jsonAcceptHeader)
} }
if err == nil && httpStatusCode == 200 { if err == nil && httpStatusCode == 200 {
err = json.Unmarshal(body, &successPayload) err = json.Unmarshal(body, &successPayload)
} else {
log.Println(string(body))
} }
return httpStatusCode, successPayload, err return httpStatusCode, successPayload, err

View File

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

View File

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

View File

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