pathes simplify

This commit is contained in:
mr 2024-08-13 11:41:29 +02:00
parent 8ffea6b337
commit 8f3ffd2348
3 changed files with 0 additions and 29 deletions

View File

@ -41,18 +41,6 @@ func (o *WorkflowController) Put() {
utils.BOOKING.String(): { utils.BOOKING.String(): {
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.BOOKING)) + "/oc/booking/", tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.BOOKING)) + "/oc/booking/",
}, },
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/",
},
} }
// store and return Id or post with UUID // store and return Id or post with UUID
var res map[string]interface{} var res map[string]interface{}
@ -107,18 +95,6 @@ func (o *WorkflowController) Post() {
utils.BOOKING.String(): { utils.BOOKING.String(): {
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.BOOKING)) + "/oc/booking/", tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.BOOKING)) + "/oc/booking/",
}, },
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/",
},
} }
var res map[string]interface{} var res map[string]interface{}
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res) json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)

View File

@ -1,7 +1,6 @@
package main package main
import ( import (
"fmt"
_ "oc-workflow/routers" _ "oc-workflow/routers"
oclib "cloud.o-forge.io/core/oc-lib" oclib "cloud.o-forge.io/core/oc-lib"
@ -39,10 +38,6 @@ func main() {
) )
oclib.Init("oc-workflow") oclib.Init("oc-workflow")
oclib.AddPath(oclib.LibDataEnum(oclib.BOOKING), o.GetStringDefault("BOOKING_URL", ":8092")) oclib.AddPath(oclib.LibDataEnum(oclib.BOOKING), o.GetStringDefault("BOOKING_URL", ":8092"))
fmt.Println(oclib.GetPath(oclib.LibDataEnum(oclib.BOOKING)))
oclib.AddPath(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), o.GetStringDefault("SHARED_WORKSPACE_URL", ":8091"))
oclib.AddPath(oclib.LibDataEnum(oclib.WORKSPACE), o.GetStringDefault("WORKSPACE_URL", ":8089"))
oclib.AddPath(oclib.LibDataEnum(oclib.WORKFLOW), o.GetStringDefault("WORKFLOW_URL", ":8088"))
// Normal beego init // Normal beego init
//if beego.BConfig.RunMode == "dev" { //if beego.BConfig.RunMode == "dev" {
beego.BConfig.WebConfig.DirectoryIndex = true beego.BConfig.WebConfig.DirectoryIndex = true

Binary file not shown.