From 5b75ed0473c4e56466ee54cf3808a1b6cf14708c Mon Sep 17 00:00:00 2001 From: mr Date: Wed, 21 Aug 2024 16:17:43 +0200 Subject: [PATCH] add peer paths --- controllers/shared_workspace.go | 9 +++++++++ main.go | 1 + 2 files changed, 10 insertions(+) diff --git a/controllers/shared_workspace.go b/controllers/shared_workspace.go index 450174b..539ed8a 100644 --- a/controllers/shared_workspace.go +++ b/controllers/shared_workspace.go @@ -47,6 +47,9 @@ func (o *SharedWorkspaceController) Put() { tools.DELETE: oclib.GetPath(oclib.LibDataEnum(oclib.WORKFLOW)) + "/oc/workflow/:id", tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.WORKFLOW)) + "/oc/workflow/", }, + utils.PEER.String(): { + tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.PEER)) + "/oc/peer", + }, } var res map[string]interface{} id := o.Ctx.Input.Param(":id") @@ -75,6 +78,9 @@ func (o *SharedWorkspaceController) Post() { tools.DELETE: oclib.GetPath(oclib.LibDataEnum(oclib.WORKFLOW)) + "/oc/workflow/:id", tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.WORKFLOW)) + "/oc/workflow/", }, + utils.PEER.String(): { + tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.PEER)) + "/oc/peer", + }, } var res map[string]interface{} json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res) @@ -122,6 +128,9 @@ func (o *SharedWorkspaceController) Delete() { tools.DELETE: oclib.GetPath(oclib.LibDataEnum(oclib.WORKFLOW)) + "/oc/workflow/:id", tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.WORKFLOW)) + "/oc/workflow/", }, + utils.PEER.String(): { + tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.PEER)) + "/oc/peer", + }, } id := o.Ctx.Input.Param(":id") caller := tools.NewHTTPCaller(paths) diff --git a/main.go b/main.go index 64510c5..714b7e3 100644 --- a/main.go +++ b/main.go @@ -33,6 +33,7 @@ func main() { 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")) + oclib.AddPath(oclib.LibDataEnum(oclib.PEER), o.GetStringDefault("WORKFLOW_URL", ":8093")) // Normal beego init //if beego.BConfig.RunMode == "dev" { beego.BConfig.WebConfig.DirectoryIndex = true