get devops count by username

Signed-off-by: runzexia <runzexia@yunify.com>
This commit is contained in:
runzexia
2019-08-28 15:47:15 +08:00
parent f22e8ea90e
commit 93db1f982e
4 changed files with 53 additions and 1 deletions

View File

@@ -134,6 +134,14 @@ func addWebService(c *restful.Container) error {
Returns(http.StatusOK, ok, models.PageableResponse{}).
Doc("List the devops projects for the workspace member").
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
ws.Route(ws.GET("/devopscount").
To(tenant.GetDevOpsProjectsCount).
Param(ws.PathParameter("member", "workspace member's username")).
Returns(http.StatusOK, ok, struct {
Count uint32 `json:"count"`
}{}).
Doc("Get the devops projects count for the member").
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
ws.Route(ws.POST("/workspaces/{workspace}/devops").
To(tenant.CreateDevopsProject).
Param(ws.PathParameter("workspace", "workspace name")).