Confirmation + Controlling API add
This commit is contained in:
@@ -85,6 +85,30 @@ func (o *WorkflowExecutionController) Get() {
|
||||
o.ServeJSON()
|
||||
}
|
||||
|
||||
// @Title Delete
|
||||
// @Description find workflow by workflowid
|
||||
// @Param id path string true "the workflowid you want to get"
|
||||
// @Success 200 {workflow} models.workflow
|
||||
// @router /:id [delete]
|
||||
func (o *WorkflowExecutionController) Delete() {
|
||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
||||
id := o.Ctx.Input.Param(":id")
|
||||
data := oclib.NewRequest(collection, user, peerID, groups, nil).LoadOne(id)
|
||||
if b := data.ToBookings(); b != nil {
|
||||
bAccess := oclib.NewRequestAdmin(oclib.LibDataEnum(oclib.BOOKING), nil)
|
||||
s := bAccess.Search(&dbs.Filters{
|
||||
And: map[string][]dbs.Filter{
|
||||
"execution_id": {{Operator: dbs.EQUAL.String(), Value: b.ExecutionID}},
|
||||
},
|
||||
}, "", false, 0, 10000)
|
||||
for _, ss := range s.Data {
|
||||
bAccess.DeleteOne(ss.GetID())
|
||||
}
|
||||
}
|
||||
o.Data["json"] = oclib.NewRequest(collection, user, peerID, groups, nil).DeleteOne(id)
|
||||
o.ServeJSON()
|
||||
}
|
||||
|
||||
// @Title Search
|
||||
// @Description find compute by key word
|
||||
// @Param search path string true "the search you want to get"
|
||||
|
||||
Reference in New Issue
Block a user