update
This commit is contained in:
parent
8f3ffd2348
commit
6f0b1ffcf4
@ -8,7 +8,7 @@ import (
|
||||
oclib "cloud.o-forge.io/core/oc-lib"
|
||||
"cloud.o-forge.io/core/oc-lib/models/utils"
|
||||
w "cloud.o-forge.io/core/oc-lib/models/workflow"
|
||||
tools "cloud.o-forge.io/core/oc-lib/tools"
|
||||
"cloud.o-forge.io/core/oc-lib/tools"
|
||||
beego "github.com/beego/beego/v2/server/web"
|
||||
"github.com/nats-io/nats.go"
|
||||
)
|
||||
@ -40,6 +40,7 @@ func (o *WorkflowController) Put() {
|
||||
var paths = map[string]map[tools.METHOD]string{
|
||||
utils.BOOKING.String(): {
|
||||
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.BOOKING)) + "/oc/booking/",
|
||||
tools.DELETE: oclib.GetPath(oclib.LibDataEnum(oclib.BOOKING)) + "/oc/booking/:id",
|
||||
},
|
||||
}
|
||||
// store and return Id or post with UUID
|
||||
@ -94,6 +95,7 @@ func (o *WorkflowController) Post() {
|
||||
var paths = map[string]map[tools.METHOD]string{
|
||||
utils.BOOKING.String(): {
|
||||
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.BOOKING)) + "/oc/booking/",
|
||||
tools.DELETE: oclib.GetPath(oclib.LibDataEnum(oclib.BOOKING)) + "/oc/booking/:id",
|
||||
},
|
||||
}
|
||||
var res map[string]interface{}
|
||||
@ -147,8 +149,15 @@ func (o *WorkflowController) Get() {
|
||||
// @Success 200 {string} delete success!
|
||||
// @router /:id [delete]
|
||||
func (o *WorkflowController) Delete() {
|
||||
var paths = map[string]map[tools.METHOD]string{
|
||||
utils.BOOKING.String(): {
|
||||
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.BOOKING)) + "/oc/booking/",
|
||||
tools.DELETE: oclib.GetPath(oclib.LibDataEnum(oclib.BOOKING)) + "/oc/booking/:id",
|
||||
},
|
||||
}
|
||||
id := o.Ctx.Input.Param(":id")
|
||||
o.Data["json"] = oclib.DeleteOne(oclib.LibDataEnum(oclib.WORKFLOW), id)
|
||||
caller := tools.NewHTTPCaller(paths)
|
||||
o.Data["json"] = oclib.DeleteOne(oclib.LibDataEnum(oclib.WORKFLOW), id, caller)
|
||||
o.ServeJSON()
|
||||
}
|
||||
|
||||
|
BIN
oc-workflow
BIN
oc-workflow
Binary file not shown.
Loading…
Reference in New Issue
Block a user