delete shared workspace

This commit is contained in:
mr 2024-08-13 15:22:24 +02:00
parent d397073d04
commit 62c2d7bb23

View File

@ -109,7 +109,22 @@ func (o *SharedWorkspaceController) Get() {
// @Success 200 {shared workspace} delete success! // @Success 200 {shared workspace} delete success!
// @router /:id [delete] // @router /:id [delete]
func (o *SharedWorkspaceController) Delete() { func (o *SharedWorkspaceController) Delete() {
var paths = map[string]map[tools.METHOD]string{
utils.SHARED_WORKSPACE.String(): {
tools.DELETE: oclib.GetPath(oclib.LibDataEnum(oclib.SHARED_WORKSPACE)) + "/oc/shared/workspace/:id",
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.SHARED_WORKSPACE)) + "/oc/shared/workspace/",
},
utils.WORKSPACE.String(): {
tools.DELETE: oclib.GetPath(oclib.LibDataEnum(oclib.WORKSPACE)) + "/oc/workspace/:id",
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.WORKSPACE)) + "/oc/workspace/",
},
utils.WORKFLOW.String(): {
tools.DELETE: oclib.GetPath(oclib.LibDataEnum(oclib.WORKFLOW)) + "/oc/workflow/:id",
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.WORKFLOW)) + "/oc/workflow/",
},
}
id := o.Ctx.Input.Param(":id") id := o.Ctx.Input.Param(":id")
o.Data["json"] = oclib.DeleteOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), id) caller := tools.NewHTTPCaller(paths)
o.Data["json"] = oclib.DeleteOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), id, caller)
o.ServeJSON() o.ServeJSON()
} }