Merge pull request #1833 from wansir/release-2.1

fix: use constants
This commit is contained in:
KubeSphere CI Bot
2020-02-11 15:01:36 +08:00
committed by GitHub
3 changed files with 4 additions and 3 deletions

View File

@@ -153,9 +153,9 @@ func ListAppVersionAudits(req *restful.Request, resp *restful.Response) {
resp.WriteHeaderAndEntity(http.StatusBadRequest, errors.Wrap(err))
return
}
conditions.Match["app"] = appId
conditions.Match[openpitrix.AppId] = appId
if versionId != "" {
conditions.Match["version"] = versionId
conditions.Match[openpitrix.VersionId] = versionId
}
result, err := openpitrix.ListAppVersionAudits(conditions, orderBy, reverse, limit, offset)

View File

@@ -270,7 +270,7 @@ func ListRepoEvents(repoId string, conditions *params.Conditions, limit, offset
describeRepoEventsRequest := &pb.DescribeRepoEventsRequest{
RepoId: []string{repoId},
}
if eventId := conditions.Match["repo_event_id"]; eventId != "" {
if eventId := conditions.Match[RepoEventId]; eventId != "" {
describeRepoEventsRequest.RepoEventId = strings.Split(eventId, "|")
}
if status := conditions.Match[Status]; status != "" {

View File

@@ -843,6 +843,7 @@ const (
VersionId = "version_id"
RepoId = "repo_id"
CategoryId = "category_id"
RepoEventId = "repo_event_id"
Status = "status"
Type = "type"
Visibility = "visibility"