Refactor OpenPitrix API path
Signed-off-by: Zhengyi Lai <zheng1@yunify.com>
This commit is contained in:
@@ -399,6 +399,10 @@ func (h *openpitrixHandler) ListApps(req *restful.Request, resp *restful.Respons
|
||||
statistics := params.GetBoolValueWithDefault(req, "statistics", false)
|
||||
conditions, err := params.ParseConditions(req)
|
||||
|
||||
if req.PathParameter("workspace") != "" {
|
||||
conditions.Match["isv"] = req.PathParameter("workspace")
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
klog.V(4).Infoln(err)
|
||||
api.HandleBadRequest(resp, nil, err)
|
||||
@@ -858,29 +862,6 @@ func (h *openpitrixHandler) ListRepos(req *restful.Request, resp *restful.Respon
|
||||
resp.WriteEntity(result)
|
||||
}
|
||||
|
||||
func (h *openpitrixHandler) ListEvents(req *restful.Request, resp *restful.Response) {
|
||||
limit, offset := params.ParsePaging(req)
|
||||
orderBy := params.GetStringValueWithDefault(req, params.OrderByParam, openpitrix.CreateTime)
|
||||
reverse := params.GetBoolValueWithDefault(req, params.ReverseParam, false)
|
||||
conditions, err := params.ParseConditions(req)
|
||||
|
||||
if err != nil {
|
||||
klog.V(4).Infoln(err)
|
||||
api.HandleBadRequest(resp, nil, err)
|
||||
return
|
||||
}
|
||||
|
||||
result, err := h.openpitrix.ListEvents(conditions, orderBy, reverse, limit, offset)
|
||||
|
||||
if err != nil {
|
||||
klog.Errorln(err)
|
||||
handleOpenpitrixError(resp, err)
|
||||
return
|
||||
}
|
||||
|
||||
resp.WriteEntity(result)
|
||||
}
|
||||
|
||||
func (h *openpitrixHandler) ListRepoEvents(req *restful.Request, resp *restful.Response) {
|
||||
repoId := req.PathParameter("repo")
|
||||
limit, offset := params.ParsePaging(req)
|
||||
|
||||
Reference in New Issue
Block a user