Compare commits
1 Commits
68c3322bba
...
chart
| Author | SHA1 | Date | |
|---|---|---|---|
| 53f683ae79 |
@@ -6,6 +6,9 @@ COPY . .
|
|||||||
|
|
||||||
RUN apk add git
|
RUN apk add git
|
||||||
|
|
||||||
|
#install bash
|
||||||
|
RUN apk add bash && PATH=$PATH:/bin/bash
|
||||||
|
|
||||||
RUN go get github.com/beego/bee/v2 && go install github.com/beego/bee/v2@master
|
RUN go get github.com/beego/bee/v2 && go install github.com/beego/bee/v2@master
|
||||||
|
|
||||||
RUN timeout 15 bee run -gendoc=true -downdoc=true -runmode=dev || :
|
RUN timeout 15 bee run -gendoc=true -downdoc=true -runmode=dev || :
|
||||||
@@ -22,7 +25,7 @@ WORKDIR /app
|
|||||||
|
|
||||||
COPY --from=builder /app/oc-shared /usr/bin/
|
COPY --from=builder /app/oc-shared /usr/bin/
|
||||||
COPY --from=builder /app/swagger /app/swagger
|
COPY --from=builder /app/swagger /app/swagger
|
||||||
|
COPY --from=builder /app/conf /app/conf
|
||||||
COPY docker_shared.json /etc/oc/shared.json
|
COPY docker_shared.json /etc/oc/shared.json
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|||||||
41
arch/diagrams/src/oc-shared.puml
Normal file
41
arch/diagrams/src/oc-shared.puml
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
@startuml
|
||||||
|
skinparam componentStyle rectangle
|
||||||
|
|
||||||
|
node "Kubernetes Cluster" {
|
||||||
|
|
||||||
|
cloud "Service: oc-shared" as oc_shared_service {
|
||||||
|
oc_shared_service : Type: NodePort
|
||||||
|
oc_shared_service : External NodePort: 8091 # Exposed NodePort for external access
|
||||||
|
oc_shared_service : Internal TargetPort: 8080
|
||||||
|
}
|
||||||
|
|
||||||
|
' Deployment for oc-shared managing the pods
|
||||||
|
node "Deployment: oc-shared" as oc_shared_deployment {
|
||||||
|
oc_shared_deployment : Replicas: {{ .Values.replicaCount }}
|
||||||
|
oc_shared_deployment : Image: registry.dev.svc.cluster.local:5000/oc-shared:latest
|
||||||
|
oc_shared_deployment : PullPolicy: IfNotPresent
|
||||||
|
oc_shared_deployment : TargetPort: 8080
|
||||||
|
|
||||||
|
node "Pod: oc-shared-1" as shared_1 {
|
||||||
|
component "Container: oc-shared" as oc_shared_container1 {
|
||||||
|
oc_shared_container1 : Internal Port: 8080
|
||||||
|
oc_shared_container1 : MONGO_DATABASE=DC_myDC
|
||||||
|
oc_shared_container1 : MONGO_URI=mongodb://mongo:27017
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
oc_shared_service --> oc_shared_deployment : Routes traffic to Deployment
|
||||||
|
oc_shared_deployment --> shared_1 : Manages Pods
|
||||||
|
|
||||||
|
' MongoDB service and statefulset
|
||||||
|
|
||||||
|
cloud "Service: mongo" as mongo_service {
|
||||||
|
mongo_service : Type: ClusterIP
|
||||||
|
mongo_service : Internal Port: 27017
|
||||||
|
}
|
||||||
|
|
||||||
|
shared_1 --> mongo_service : Connects to MongoDB
|
||||||
|
|
||||||
|
}
|
||||||
|
@enduml
|
||||||
@@ -1,310 +0,0 @@
|
|||||||
package controllers
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"slices"
|
|
||||||
|
|
||||||
oclib "cloud.o-forge.io/core/oc-lib"
|
|
||||||
"cloud.o-forge.io/core/oc-lib/tools"
|
|
||||||
beego "github.com/beego/beego/v2/server/web"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Operations about workspace
|
|
||||||
type CollaborativeAreaController struct {
|
|
||||||
beego.Controller
|
|
||||||
}
|
|
||||||
|
|
||||||
var paths = map[tools.DataType]map[tools.METHOD]string{ // paths used to call other OC services
|
|
||||||
tools.COLLABORATIVE_AREA: {
|
|
||||||
tools.DELETE: "/oc/shared/workspace/:id?is_remote=true",
|
|
||||||
tools.POST: "/oc/shared/workspace/?is_remote=true",
|
|
||||||
},
|
|
||||||
tools.WORKSPACE: {
|
|
||||||
tools.DELETE: "/oc/workspace/:id?is_remote=true",
|
|
||||||
tools.POST: "/oc/workspace/?is_remote=true",
|
|
||||||
},
|
|
||||||
tools.WORKFLOW: {
|
|
||||||
tools.DELETE: "/oc/workflow/:id?is_remote=true",
|
|
||||||
tools.POST: "/oc/workflow/?is_remote=true",
|
|
||||||
},
|
|
||||||
tools.PEER: {
|
|
||||||
tools.POST: "/oc/peer",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Title Search
|
|
||||||
// @Description search shared workspace
|
|
||||||
// @Param search path string true "the word search you want to get"
|
|
||||||
// @Success 200 {shared workspace} models.shared_workspace
|
|
||||||
// @router /search/:search [get]
|
|
||||||
func (o *CollaborativeAreaController) Search() {
|
|
||||||
// store and return Id or post with UUID
|
|
||||||
search := o.Ctx.Input.Param(":search")
|
|
||||||
o.Data["json"] = oclib.Search(nil, search, oclib.LibDataEnum(tools.COLLABORATIVE_AREA))
|
|
||||||
o.ServeJSON()
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Title Update
|
|
||||||
// @Description create shared workspaces
|
|
||||||
// @Param id path string true "the shared workspace id you want to get"
|
|
||||||
// @Param body body models.workspace true "The shared workspace content"
|
|
||||||
// @Success 200 {shared workspace} models.shared_workspace
|
|
||||||
// @router /:id [put]
|
|
||||||
func (o *CollaborativeAreaController) Put() {
|
|
||||||
// store and return Id or post with UUID
|
|
||||||
var res map[string]interface{}
|
|
||||||
id := o.Ctx.Input.Param(":id")
|
|
||||||
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
|
||||||
fmt.Println("UPDATE", res)
|
|
||||||
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), res, id, caller)
|
|
||||||
o.ServeJSON()
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Title Create
|
|
||||||
// @Description create shared workspace
|
|
||||||
// @Param data body json true "body for data content (Json format)"
|
|
||||||
// @Success 200 {shared workspace} models.shared_workspace
|
|
||||||
// @router / [post]
|
|
||||||
func (o *CollaborativeAreaController) Post() {
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
|
||||||
var res map[string]interface{}
|
|
||||||
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
|
|
||||||
o.Data["json"] = oclib.StoreOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), res, caller)
|
|
||||||
o.ServeJSON()
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Title GetAll
|
|
||||||
// @Description find shared workspace by id
|
|
||||||
// @Success 200 {shared_workspace} models.shared_workspace
|
|
||||||
// @router / [get]
|
|
||||||
func (o *CollaborativeAreaController) GetAll() {
|
|
||||||
o.Data["json"] = oclib.LoadAll(oclib.LibDataEnum(tools.COLLABORATIVE_AREA))
|
|
||||||
o.ServeJSON()
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Title Get
|
|
||||||
// @Description find shared workspace by id
|
|
||||||
// @Param id path string true "the id you want to get"
|
|
||||||
// @Success 200 {shared workspace} models.shared_workspace
|
|
||||||
// @router /:id [get]
|
|
||||||
func (o *CollaborativeAreaController) Get() {
|
|
||||||
id := o.Ctx.Input.Param(":id")
|
|
||||||
o.Data["json"] = oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
|
||||||
o.ServeJSON()
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Title Add Workspace
|
|
||||||
// @Description find shared workspace by id
|
|
||||||
// @Param id path string true "the id you want to get"
|
|
||||||
// @Param id2 path string true "the id you want to add"
|
|
||||||
// @Success 200 {shared workspace} models.shared_workspace
|
|
||||||
// @router /:id/workspace/:id2 [delete]
|
|
||||||
func (o *CollaborativeAreaController) RemoveWorkspace() {
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
|
||||||
id := o.Ctx.Input.Param(":id")
|
|
||||||
id2 := o.Ctx.Input.Param(":id2")
|
|
||||||
r := oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
|
||||||
shared := r.ToCollaborativeArea()
|
|
||||||
newWorkspace := []string{}
|
|
||||||
if slices.Contains(shared.Workspaces, id2) {
|
|
||||||
for _, w := range shared.Workspaces {
|
|
||||||
if w != id2 {
|
|
||||||
newWorkspace = append(newWorkspace, w)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
shared.Workspaces = newWorkspace
|
|
||||||
}
|
|
||||||
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), shared.Serialize(), id, caller)
|
|
||||||
o.ServeJSON()
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Title Remove Workflow
|
|
||||||
// @Description find shared workspace by id
|
|
||||||
// @Param id path string true "the id you want to get"
|
|
||||||
// @Param id2 path string true "the id you want to add"
|
|
||||||
// @Success 200 {shared workspace} models.shared_workspace
|
|
||||||
// @router /:id/workflow/:id2 [delete]
|
|
||||||
func (o *CollaborativeAreaController) RemoveWorkflow() {
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
|
||||||
id := o.Ctx.Input.Param(":id")
|
|
||||||
id2 := o.Ctx.Input.Param(":id2")
|
|
||||||
r := oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
|
||||||
fmt.Println("RemoveWorkflow", r)
|
|
||||||
shared := r.ToCollaborativeArea()
|
|
||||||
newWorkflows := []string{}
|
|
||||||
if slices.Contains(shared.Workflows, id2) {
|
|
||||||
for _, w := range shared.Workflows {
|
|
||||||
if w != id2 {
|
|
||||||
newWorkflows = append(newWorkflows, w)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
shared.Workflows = newWorkflows
|
|
||||||
}
|
|
||||||
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), shared.Serialize(), id, caller)
|
|
||||||
o.ServeJSON()
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Title Remove Peer
|
|
||||||
// @Description find shared workspace by id
|
|
||||||
// @Param id path string true "the id you want to get"
|
|
||||||
// @Param id2 path string true "the id you want to add"
|
|
||||||
// @Success 200 {shared workspace} models.shared_workspace
|
|
||||||
// @router /:id/peer/:id2 [delete]
|
|
||||||
func (o *CollaborativeAreaController) RemovePeer() {
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
|
||||||
id := o.Ctx.Input.Param(":id")
|
|
||||||
id2 := o.Ctx.Input.Param(":id2")
|
|
||||||
r := oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
|
||||||
shared := r.ToCollaborativeArea()
|
|
||||||
newPeers := []string{}
|
|
||||||
if shared.CreatorID != id2 {
|
|
||||||
o.Data["json"] = map[string]interface{}{
|
|
||||||
"data": nil,
|
|
||||||
"code": 409,
|
|
||||||
"error": "You can't remove the creator from the shared workspace",
|
|
||||||
}
|
|
||||||
o.ServeJSON()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if slices.Contains(shared.Peers, id) && shared.CreatorID != id2 {
|
|
||||||
for _, peer := range shared.Peers {
|
|
||||||
if peer != id2 {
|
|
||||||
newPeers = append(newPeers, peer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
shared.Peers = newPeers
|
|
||||||
}
|
|
||||||
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), shared.Serialize(), id, caller)
|
|
||||||
o.ServeJSON()
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Title Remove Rule
|
|
||||||
// @Description find shared workspace by id
|
|
||||||
// @Param id path string true "the id you want to get"
|
|
||||||
// @Param id2 path string true "the id you want to add"
|
|
||||||
// @Success 200 {shared workspace} models.shared_workspace
|
|
||||||
// @router /:id/rule/:id2 [delete]
|
|
||||||
func (o *CollaborativeAreaController) RemoveRule() {
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
|
||||||
id := o.Ctx.Input.Param(":id")
|
|
||||||
id2 := o.Ctx.Input.Param(":id2")
|
|
||||||
r := oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
|
||||||
shared := r.ToCollaborativeArea()
|
|
||||||
newRules := []string{}
|
|
||||||
if shared != nil && slices.Contains(shared.Rules, id2) {
|
|
||||||
for _, rule := range shared.Rules {
|
|
||||||
if rule != id2 {
|
|
||||||
newRules = append(newRules, rule)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
shared.Rules = newRules
|
|
||||||
}
|
|
||||||
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), shared.Serialize(), id, caller)
|
|
||||||
o.ServeJSON()
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Title Add Workspace
|
|
||||||
// @Description find shared workspace by id
|
|
||||||
// @Param id path string true "the id you want to get"
|
|
||||||
// @Param id2 path string true "the id you want to add"
|
|
||||||
// @Success 200 {shared workspace} models.shared_workspace
|
|
||||||
// @router /:id/workspace/:id2 [post]
|
|
||||||
func (o *CollaborativeAreaController) AddWorkspace() {
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
|
||||||
id := o.Ctx.Input.Param(":id")
|
|
||||||
id2 := o.Ctx.Input.Param(":id2")
|
|
||||||
r := oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
|
||||||
if r.Code != 200 {
|
|
||||||
o.Data["json"] = r
|
|
||||||
o.ServeJSON()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
shared := r.ToCollaborativeArea()
|
|
||||||
if shared != nil && !slices.Contains(shared.Workspaces, id2) {
|
|
||||||
shared.Workspaces = append(shared.Workspaces, id2)
|
|
||||||
}
|
|
||||||
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), shared.Serialize(), id, caller)
|
|
||||||
o.ServeJSON()
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Title Add Workflow
|
|
||||||
// @Description find shared workspace by id
|
|
||||||
// @Param id path string true "the id you want to get"
|
|
||||||
// @Param id2 path string true "the id you want to add"
|
|
||||||
// @Success 200 {shared workspace} models.shared_workspace
|
|
||||||
// @router /:id/workflow/:id2 [post]
|
|
||||||
func (o *CollaborativeAreaController) AddWorkflow() {
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
|
||||||
id := o.Ctx.Input.Param(":id")
|
|
||||||
id2 := o.Ctx.Input.Param(":id2")
|
|
||||||
r := oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
|
||||||
shared := r.ToCollaborativeArea()
|
|
||||||
if shared != nil && !slices.Contains(shared.Workflows, id2) {
|
|
||||||
shared.Workflows = append(shared.Workflows, id2)
|
|
||||||
}
|
|
||||||
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), shared.Serialize(), id, caller)
|
|
||||||
o.ServeJSON()
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Title Add Peer
|
|
||||||
// @Description find shared workspace by id
|
|
||||||
// @Param id path string true "the id you want to get"
|
|
||||||
// @Param id2 path string true "the id you want to add"
|
|
||||||
// @Success 200 {shared workspace} models.shared_workspace
|
|
||||||
// @router /:id/peer/:id2 [post]
|
|
||||||
func (o *CollaborativeAreaController) AddPeer() {
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
|
||||||
id := o.Ctx.Input.Param(":id")
|
|
||||||
id2 := o.Ctx.Input.Param(":id2")
|
|
||||||
r := oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
|
||||||
shared := r.ToCollaborativeArea()
|
|
||||||
if shared != nil && !slices.Contains(shared.Peers, id2) {
|
|
||||||
shared.Peers = append(shared.Peers, id2)
|
|
||||||
}
|
|
||||||
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), shared.Serialize(), id, caller)
|
|
||||||
o.ServeJSON()
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Title Add Rule
|
|
||||||
// @Description find shared workspace by id
|
|
||||||
// @Param id path string true "the id you want to get"
|
|
||||||
// @Param id2 path string true "the id you want to add"
|
|
||||||
// @Success 200 {shared workspace} models.shared_workspace
|
|
||||||
// @router /:id/rule/:id2 [post]
|
|
||||||
func (o *CollaborativeAreaController) AddRule() {
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
|
||||||
id := o.Ctx.Input.Param(":id")
|
|
||||||
id2 := o.Ctx.Input.Param(":id2")
|
|
||||||
r := oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
|
||||||
shared := r.ToCollaborativeArea()
|
|
||||||
if shared != nil && !slices.Contains(shared.Rules, id2) {
|
|
||||||
shared.Rules = append(shared.Rules, id2)
|
|
||||||
}
|
|
||||||
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), shared.Serialize(), id, caller)
|
|
||||||
o.ServeJSON()
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Title Delete
|
|
||||||
// @Description delete the shared workspace
|
|
||||||
// @Param id path string true "The id you want to delete"
|
|
||||||
// @Success 200 {shared workspace} delete success!
|
|
||||||
// @router /:id [delete]
|
|
||||||
func (o *CollaborativeAreaController) Delete() {
|
|
||||||
id := o.Ctx.Input.Param(":id")
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
|
||||||
o.Data["json"] = oclib.DeleteOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id, caller)
|
|
||||||
o.ServeJSON()
|
|
||||||
}
|
|
||||||
473
controllers/shared_workspace.go
Normal file
473
controllers/shared_workspace.go
Normal file
@@ -0,0 +1,473 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"slices"
|
||||||
|
|
||||||
|
oclib "cloud.o-forge.io/core/oc-lib"
|
||||||
|
"cloud.o-forge.io/core/oc-lib/models/utils"
|
||||||
|
"cloud.o-forge.io/core/oc-lib/tools"
|
||||||
|
beego "github.com/beego/beego/v2/server/web"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Operations about workspace
|
||||||
|
type SharedWorkspaceController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title Search
|
||||||
|
// @Description search shared workspace
|
||||||
|
// @Param search path string true "the word search you want to get"
|
||||||
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
|
// @router /search/:search [get]
|
||||||
|
func (o *SharedWorkspaceController) Search() {
|
||||||
|
// store and return Id or post with UUID
|
||||||
|
search := o.Ctx.Input.Param(":search")
|
||||||
|
o.Data["json"] = oclib.Search(nil, search, oclib.LibDataEnum(oclib.SHARED_WORKSPACE))
|
||||||
|
o.ServeJSON()
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title Update
|
||||||
|
// @Description create shared workspaces
|
||||||
|
// @Param id path string true "the shared workspace id you want to get"
|
||||||
|
// @Param body body models.workspace true "The shared workspace content"
|
||||||
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
|
// @router /:id [put]
|
||||||
|
func (o *SharedWorkspaceController) Put() {
|
||||||
|
// store and return Id or post with UUID
|
||||||
|
var paths = map[string]map[tools.METHOD]string{ // paths used to send to peers
|
||||||
|
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/",
|
||||||
|
},
|
||||||
|
utils.PEER.String(): {
|
||||||
|
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.PEER)) + "/oc/peer",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
var res map[string]interface{}
|
||||||
|
id := o.Ctx.Input.Param(":id")
|
||||||
|
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
|
||||||
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
|
fmt.Println("UPDATE", res)
|
||||||
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), res, id, caller)
|
||||||
|
o.ServeJSON()
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title Create
|
||||||
|
// @Description create shared workspace
|
||||||
|
// @Param data body json true "body for data content (Json format)"
|
||||||
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
|
// @router / [post]
|
||||||
|
func (o *SharedWorkspaceController) Post() {
|
||||||
|
var paths = map[string]map[tools.METHOD]string{ // paths used to call other OC services
|
||||||
|
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/",
|
||||||
|
},
|
||||||
|
utils.PEER.String(): {
|
||||||
|
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.PEER)) + "/oc/peer",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
|
var res map[string]interface{}
|
||||||
|
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
|
||||||
|
|
||||||
|
o.Data["json"] = oclib.StoreOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), res, caller)
|
||||||
|
o.ServeJSON()
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title GetAll
|
||||||
|
// @Description find shared workspace by id
|
||||||
|
// @Success 200 {shared_workspace} models.shared_workspace
|
||||||
|
// @router / [get]
|
||||||
|
func (o *SharedWorkspaceController) GetAll() {
|
||||||
|
o.Data["json"] = oclib.LoadAll(oclib.LibDataEnum(oclib.SHARED_WORKSPACE))
|
||||||
|
o.ServeJSON()
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title Get
|
||||||
|
// @Description find shared workspace by id
|
||||||
|
// @Param id path string true "the id you want to get"
|
||||||
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
|
// @router /:id [get]
|
||||||
|
func (o *SharedWorkspaceController) Get() {
|
||||||
|
id := o.Ctx.Input.Param(":id")
|
||||||
|
o.Data["json"] = oclib.LoadOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), id)
|
||||||
|
o.ServeJSON()
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title Add Workspace
|
||||||
|
// @Description find shared workspace by id
|
||||||
|
// @Param id path string true "the id you want to get"
|
||||||
|
// @Param id2 path string true "the id you want to add"
|
||||||
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
|
// @router /:id/workspace/:id2 [delete]
|
||||||
|
func (o *SharedWorkspaceController) RemoveWorkspace() {
|
||||||
|
var paths = map[string]map[tools.METHOD]string{ // paths used to call other OC services
|
||||||
|
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/",
|
||||||
|
},
|
||||||
|
utils.PEER.String(): {
|
||||||
|
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.PEER)) + "/oc/peer",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
|
id := o.Ctx.Input.Param(":id")
|
||||||
|
id2 := o.Ctx.Input.Param(":id2")
|
||||||
|
r := oclib.LoadOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), id)
|
||||||
|
shared := r.ToSharedWorkspace()
|
||||||
|
newWorkspace := []string{}
|
||||||
|
if slices.Contains(shared.Workspaces, id2) {
|
||||||
|
for _, w := range shared.Workspaces {
|
||||||
|
if w != id2 {
|
||||||
|
newWorkspace = append(newWorkspace, w)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
shared.Workspaces = newWorkspace
|
||||||
|
}
|
||||||
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), shared.Serialize(), id, caller)
|
||||||
|
o.ServeJSON()
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title Remove Workflow
|
||||||
|
// @Description find shared workspace by id
|
||||||
|
// @Param id path string true "the id you want to get"
|
||||||
|
// @Param id2 path string true "the id you want to add"
|
||||||
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
|
// @router /:id/workflow/:id2 [delete]
|
||||||
|
func (o *SharedWorkspaceController) RemoveWorkflow() {
|
||||||
|
var paths = map[string]map[tools.METHOD]string{ // paths used to call other OC services
|
||||||
|
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/",
|
||||||
|
},
|
||||||
|
utils.PEER.String(): {
|
||||||
|
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.PEER)) + "/oc/peer",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
|
id := o.Ctx.Input.Param(":id")
|
||||||
|
id2 := o.Ctx.Input.Param(":id2")
|
||||||
|
r := oclib.LoadOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), id)
|
||||||
|
fmt.Println("RemoveWorkflow", r)
|
||||||
|
shared := r.ToSharedWorkspace()
|
||||||
|
newWorkflows := []string{}
|
||||||
|
if slices.Contains(shared.Workflows, id2) {
|
||||||
|
for _, w := range shared.Workflows {
|
||||||
|
if w != id2 {
|
||||||
|
newWorkflows = append(newWorkflows, w)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
shared.Workflows = newWorkflows
|
||||||
|
}
|
||||||
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), shared.Serialize(), id, caller)
|
||||||
|
o.ServeJSON()
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title Remove Peer
|
||||||
|
// @Description find shared workspace by id
|
||||||
|
// @Param id path string true "the id you want to get"
|
||||||
|
// @Param id2 path string true "the id you want to add"
|
||||||
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
|
// @router /:id/peer/:id2 [delete]
|
||||||
|
func (o *SharedWorkspaceController) RemovePeer() {
|
||||||
|
var paths = map[string]map[tools.METHOD]string{ // paths used to call other OC services
|
||||||
|
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/",
|
||||||
|
},
|
||||||
|
utils.PEER.String(): {
|
||||||
|
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.PEER)) + "/oc/peer",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
|
id := o.Ctx.Input.Param(":id")
|
||||||
|
id2 := o.Ctx.Input.Param(":id2")
|
||||||
|
r := oclib.LoadOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), id)
|
||||||
|
shared := r.ToSharedWorkspace()
|
||||||
|
newPeers := []string{}
|
||||||
|
if shared.CreatorID != id2 {
|
||||||
|
o.Data["json"] = map[string]interface{}{
|
||||||
|
"data": nil,
|
||||||
|
"code": 409,
|
||||||
|
"error": "You can't remove the creator from the shared workspace",
|
||||||
|
}
|
||||||
|
o.ServeJSON()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if slices.Contains(shared.Peers, id) && shared.CreatorID != id2 {
|
||||||
|
for _, peer := range shared.Peers {
|
||||||
|
if peer != id2 {
|
||||||
|
newPeers = append(newPeers, peer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
shared.Peers = newPeers
|
||||||
|
}
|
||||||
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), shared.Serialize(), id, caller)
|
||||||
|
o.ServeJSON()
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title Remove Rule
|
||||||
|
// @Description find shared workspace by id
|
||||||
|
// @Param id path string true "the id you want to get"
|
||||||
|
// @Param id2 path string true "the id you want to add"
|
||||||
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
|
// @router /:id/rule/:id2 [delete]
|
||||||
|
func (o *SharedWorkspaceController) RemoveRule() {
|
||||||
|
var paths = map[string]map[tools.METHOD]string{ // paths used to call other OC services
|
||||||
|
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/",
|
||||||
|
},
|
||||||
|
utils.PEER.String(): {
|
||||||
|
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.PEER)) + "/oc/peer",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
|
id := o.Ctx.Input.Param(":id")
|
||||||
|
id2 := o.Ctx.Input.Param(":id2")
|
||||||
|
r := oclib.LoadOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), id)
|
||||||
|
shared := r.ToSharedWorkspace()
|
||||||
|
newRules := []string{}
|
||||||
|
if shared != nil && slices.Contains(shared.Rules, id2) {
|
||||||
|
for _, rule := range shared.Rules {
|
||||||
|
if rule != id2 {
|
||||||
|
newRules = append(newRules, rule)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
shared.Rules = newRules
|
||||||
|
}
|
||||||
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), shared.Serialize(), id, caller)
|
||||||
|
o.ServeJSON()
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title Add Workspace
|
||||||
|
// @Description find shared workspace by id
|
||||||
|
// @Param id path string true "the id you want to get"
|
||||||
|
// @Param id2 path string true "the id you want to add"
|
||||||
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
|
// @router /:id/workspace/:id2 [post]
|
||||||
|
func (o *SharedWorkspaceController) AddWorkspace() {
|
||||||
|
var paths = map[string]map[tools.METHOD]string{ // paths used to call other OC services
|
||||||
|
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/",
|
||||||
|
},
|
||||||
|
utils.PEER.String(): {
|
||||||
|
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.PEER)) + "/oc/peer",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
|
id := o.Ctx.Input.Param(":id")
|
||||||
|
id2 := o.Ctx.Input.Param(":id2")
|
||||||
|
r := oclib.LoadOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), id)
|
||||||
|
if r.Code != 200 {
|
||||||
|
o.Data["json"] = r
|
||||||
|
o.ServeJSON()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
shared := r.ToSharedWorkspace()
|
||||||
|
if shared != nil && !slices.Contains(shared.Workspaces, id2) {
|
||||||
|
shared.Workspaces = append(shared.Workspaces, id2)
|
||||||
|
}
|
||||||
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), shared.Serialize(), id, caller)
|
||||||
|
o.ServeJSON()
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title Add Workflow
|
||||||
|
// @Description find shared workspace by id
|
||||||
|
// @Param id path string true "the id you want to get"
|
||||||
|
// @Param id2 path string true "the id you want to add"
|
||||||
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
|
// @router /:id/workflow/:id2 [post]
|
||||||
|
func (o *SharedWorkspaceController) AddWorkflow() {
|
||||||
|
var paths = map[string]map[tools.METHOD]string{ // paths used to call other OC services
|
||||||
|
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/",
|
||||||
|
},
|
||||||
|
utils.PEER.String(): {
|
||||||
|
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.PEER)) + "/oc/peer",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
|
id := o.Ctx.Input.Param(":id")
|
||||||
|
id2 := o.Ctx.Input.Param(":id2")
|
||||||
|
fmt.Println("AddWorkflow", id, id2)
|
||||||
|
r := oclib.LoadOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), id)
|
||||||
|
shared := r.ToSharedWorkspace()
|
||||||
|
if shared != nil && !slices.Contains(shared.Workflows, id2) {
|
||||||
|
shared.Workflows = append(shared.Workflows, id2)
|
||||||
|
}
|
||||||
|
fmt.Println("AddWorkflow", shared.Workflows)
|
||||||
|
|
||||||
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), shared.Serialize(), id, caller)
|
||||||
|
o.ServeJSON()
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title Add Peer
|
||||||
|
// @Description find shared workspace by id
|
||||||
|
// @Param id path string true "the id you want to get"
|
||||||
|
// @Param id2 path string true "the id you want to add"
|
||||||
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
|
// @router /:id/peer/:id2 [post]
|
||||||
|
func (o *SharedWorkspaceController) AddPeer() {
|
||||||
|
var paths = map[string]map[tools.METHOD]string{ // paths used to call other OC services
|
||||||
|
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/",
|
||||||
|
},
|
||||||
|
utils.PEER.String(): {
|
||||||
|
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.PEER)) + "/oc/peer",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
|
id := o.Ctx.Input.Param(":id")
|
||||||
|
id2 := o.Ctx.Input.Param(":id2")
|
||||||
|
r := oclib.LoadOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), id)
|
||||||
|
shared := r.ToSharedWorkspace()
|
||||||
|
if shared != nil && !slices.Contains(shared.Peers, id2) {
|
||||||
|
shared.Peers = append(shared.Peers, id2)
|
||||||
|
}
|
||||||
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), shared.Serialize(), id, caller)
|
||||||
|
o.ServeJSON()
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title Add Rule
|
||||||
|
// @Description find shared workspace by id
|
||||||
|
// @Param id path string true "the id you want to get"
|
||||||
|
// @Param id2 path string true "the id you want to add"
|
||||||
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
|
// @router /:id/rule/:id2 [post]
|
||||||
|
func (o *SharedWorkspaceController) AddRule() {
|
||||||
|
var paths = map[string]map[tools.METHOD]string{ // paths used to send to peers
|
||||||
|
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/",
|
||||||
|
},
|
||||||
|
utils.PEER.String(): {
|
||||||
|
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.PEER)) + "/oc/peer",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
|
id := o.Ctx.Input.Param(":id")
|
||||||
|
id2 := o.Ctx.Input.Param(":id2")
|
||||||
|
r := oclib.LoadOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), id)
|
||||||
|
shared := r.ToSharedWorkspace()
|
||||||
|
if shared != nil && !slices.Contains(shared.Rules, id2) {
|
||||||
|
shared.Rules = append(shared.Rules, id2)
|
||||||
|
}
|
||||||
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), shared.Serialize(), id, caller)
|
||||||
|
o.ServeJSON()
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title Delete
|
||||||
|
// @Description delete the shared workspace
|
||||||
|
// @Param id path string true "The id you want to delete"
|
||||||
|
// @Success 200 {shared workspace} delete success!
|
||||||
|
// @router /:id [delete]
|
||||||
|
func (o *SharedWorkspaceController) Delete() {
|
||||||
|
var paths = map[string]map[tools.METHOD]string{ // paths used to send to peers
|
||||||
|
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/",
|
||||||
|
},
|
||||||
|
utils.PEER.String(): {
|
||||||
|
tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.PEER)) + "/oc/peer",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
id := o.Ctx.Input.Param(":id")
|
||||||
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
|
o.Data["json"] = oclib.DeleteOne(oclib.LibDataEnum(oclib.SHARED_WORKSPACE), id, caller)
|
||||||
|
o.ServeJSON()
|
||||||
|
}
|
||||||
14
go.mod
14
go.mod
@@ -5,8 +5,8 @@ go 1.22.0
|
|||||||
toolchain go1.22.4
|
toolchain go1.22.4
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.o-forge.io/core/oc-lib v0.0.0-20241002120813-a09a04e1a71e
|
cloud.o-forge.io/core/oc-lib v0.0.0-20240904135449-4f0ab6a3760f
|
||||||
github.com/beego/beego/v2 v2.3.1
|
github.com/beego/beego/v2 v2.3.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@@ -16,12 +16,12 @@ require (
|
|||||||
github.com/gabriel-vasile/mimetype v1.4.5 // indirect
|
github.com/gabriel-vasile/mimetype v1.4.5 // indirect
|
||||||
github.com/go-playground/locales v0.14.1 // indirect
|
github.com/go-playground/locales v0.14.1 // indirect
|
||||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||||
github.com/go-playground/validator/v10 v10.22.1 // indirect
|
github.com/go-playground/validator/v10 v10.22.0 // indirect
|
||||||
github.com/golang/snappy v0.0.4 // indirect
|
github.com/golang/snappy v0.0.4 // indirect
|
||||||
github.com/google/uuid v1.6.0 // indirect
|
github.com/google/uuid v1.6.0 // indirect
|
||||||
github.com/goraz/onion v0.1.3 // indirect
|
github.com/goraz/onion v0.1.3 // indirect
|
||||||
github.com/hashicorp/golang-lru v1.0.2 // indirect
|
github.com/hashicorp/golang-lru v1.0.2 // indirect
|
||||||
github.com/klauspost/compress v1.17.10 // indirect
|
github.com/klauspost/compress v1.17.9 // indirect
|
||||||
github.com/kr/text v0.2.0 // indirect
|
github.com/kr/text v0.2.0 // indirect
|
||||||
github.com/leodido/go-urn v1.4.0 // indirect
|
github.com/leodido/go-urn v1.4.0 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
@@ -46,9 +46,9 @@ require (
|
|||||||
github.com/xdg-go/scram v1.1.2 // indirect
|
github.com/xdg-go/scram v1.1.2 // indirect
|
||||||
github.com/xdg-go/stringprep v1.0.4 // indirect
|
github.com/xdg-go/stringprep v1.0.4 // indirect
|
||||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
|
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
|
||||||
go.mongodb.org/mongo-driver v1.17.1 // indirect
|
go.mongodb.org/mongo-driver v1.16.1 // indirect
|
||||||
golang.org/x/crypto v0.27.0 // indirect
|
golang.org/x/crypto v0.26.0 // indirect
|
||||||
golang.org/x/net v0.29.0 // indirect
|
golang.org/x/net v0.28.0 // indirect
|
||||||
golang.org/x/sync v0.8.0 // indirect
|
golang.org/x/sync v0.8.0 // indirect
|
||||||
golang.org/x/sys v0.25.0 // indirect
|
golang.org/x/sys v0.25.0 // indirect
|
||||||
golang.org/x/text v0.18.0 // indirect
|
golang.org/x/text v0.18.0 // indirect
|
||||||
|
|||||||
22
go.sum
22
go.sum
@@ -1,18 +1,8 @@
|
|||||||
cloud.o-forge.io/core/oc-lib v0.0.0-20240904135449-4f0ab6a3760f h1:v9mw3uNg/DJswOvHooMu8/BMedA+vIXbma+8iUwsjUI=
|
cloud.o-forge.io/core/oc-lib v0.0.0-20240904135449-4f0ab6a3760f h1:v9mw3uNg/DJswOvHooMu8/BMedA+vIXbma+8iUwsjUI=
|
||||||
cloud.o-forge.io/core/oc-lib v0.0.0-20240904135449-4f0ab6a3760f/go.mod h1:FIJD0taWLJ5pjQLJ6sfE2KlTkvbmk5SMcyrxdjsaVz0=
|
cloud.o-forge.io/core/oc-lib v0.0.0-20240904135449-4f0ab6a3760f/go.mod h1:FIJD0taWLJ5pjQLJ6sfE2KlTkvbmk5SMcyrxdjsaVz0=
|
||||||
cloud.o-forge.io/core/oc-lib v0.0.0-20240927112324-cdf513c2c454 h1:F5/oBMypnb6Mdvcf6N8y8v/DgfglPQ6VsQUY7hjC2zA=
|
|
||||||
cloud.o-forge.io/core/oc-lib v0.0.0-20240927112324-cdf513c2c454/go.mod h1:FIJD0taWLJ5pjQLJ6sfE2KlTkvbmk5SMcyrxdjsaVz0=
|
|
||||||
cloud.o-forge.io/core/oc-lib v0.0.0-20241002084552-3c1a84011ecc h1:1R4stJxXDMQ6joJZl9gQ2TUGW6S2jct2lhHUubPChs0=
|
|
||||||
cloud.o-forge.io/core/oc-lib v0.0.0-20241002084552-3c1a84011ecc/go.mod h1:FIJD0taWLJ5pjQLJ6sfE2KlTkvbmk5SMcyrxdjsaVz0=
|
|
||||||
cloud.o-forge.io/core/oc-lib v0.0.0-20241002102322-c309d9762350 h1:ybK3Qz1inr9xgrJwbHjSOTNaFIyX+AVINyzqcsvpATY=
|
|
||||||
cloud.o-forge.io/core/oc-lib v0.0.0-20241002102322-c309d9762350/go.mod h1:FIJD0taWLJ5pjQLJ6sfE2KlTkvbmk5SMcyrxdjsaVz0=
|
|
||||||
cloud.o-forge.io/core/oc-lib v0.0.0-20241002120813-a09a04e1a71e h1:77QHk5JSf0q13B/Ai3xjcsGSS7nX+9AfxcsYz5oDo/A=
|
|
||||||
cloud.o-forge.io/core/oc-lib v0.0.0-20241002120813-a09a04e1a71e/go.mod h1:t+zpCTVKVdHH/BImwtMYY2QIWLMXKgY4n/JhFm3Vpu8=
|
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/beego/beego/v2 v2.3.0 h1:iECVwzm6egw6iw6tkWrEDqXG4NQtKLQ6QBSYqlM6T/I=
|
github.com/beego/beego/v2 v2.3.0 h1:iECVwzm6egw6iw6tkWrEDqXG4NQtKLQ6QBSYqlM6T/I=
|
||||||
github.com/beego/beego/v2 v2.3.0/go.mod h1:Ob/5BJ9fIKZLd4s9ZV3o9J6odkkIyL83et+p98gyYXo=
|
github.com/beego/beego/v2 v2.3.0/go.mod h1:Ob/5BJ9fIKZLd4s9ZV3o9J6odkkIyL83et+p98gyYXo=
|
||||||
github.com/beego/beego/v2 v2.3.1 h1:7MUKMpJYzOXtCUsTEoXOxsDV/UcHw6CPbaWMlthVNsc=
|
|
||||||
github.com/beego/beego/v2 v2.3.1/go.mod h1:5cqHsOHJIxkq44tBpRvtDe59GuVRVv/9/tyVDxd5ce4=
|
|
||||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||||
@@ -39,8 +29,6 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn
|
|||||||
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||||
github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao=
|
github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao=
|
||||||
github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
|
github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
|
||||||
github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA=
|
|
||||||
github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
|
|
||||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||||
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
||||||
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||||
@@ -61,8 +49,6 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7
|
|||||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||||
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
|
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
|
||||||
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
|
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
|
||||||
github.com/klauspost/compress v1.17.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0=
|
|
||||||
github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
|
|
||||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
@@ -140,17 +126,11 @@ github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfS
|
|||||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||||
go.mongodb.org/mongo-driver v1.16.1 h1:rIVLL3q0IHM39dvE+z2ulZLp9ENZKThVfuvN/IiN4l8=
|
go.mongodb.org/mongo-driver v1.16.1 h1:rIVLL3q0IHM39dvE+z2ulZLp9ENZKThVfuvN/IiN4l8=
|
||||||
go.mongodb.org/mongo-driver v1.16.1/go.mod h1:oB6AhJQvFQL4LEHyXi6aJzQJtBiTQHiAd83l0GdFaiw=
|
go.mongodb.org/mongo-driver v1.16.1/go.mod h1:oB6AhJQvFQL4LEHyXi6aJzQJtBiTQHiAd83l0GdFaiw=
|
||||||
go.mongodb.org/mongo-driver v1.17.0 h1:Hp4q2MCjvY19ViwimTs00wHi7G4yzxh4/2+nTx8r40k=
|
|
||||||
go.mongodb.org/mongo-driver v1.17.0/go.mod h1:wwWm/+BuOddhcq3n68LKRmgk2wXzmF6s0SFOa0GINL4=
|
|
||||||
go.mongodb.org/mongo-driver v1.17.1 h1:Wic5cJIwJgSpBhe3lx3+/RybR5PiYRMpVFgO7cOHyIM=
|
|
||||||
go.mongodb.org/mongo-driver v1.17.1/go.mod h1:wwWm/+BuOddhcq3n68LKRmgk2wXzmF6s0SFOa0GINL4=
|
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
|
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
|
||||||
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
|
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
|
||||||
golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
|
|
||||||
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
|
|
||||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
@@ -159,8 +139,6 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
|
|||||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||||
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
|
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
|
||||||
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
|
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
|
||||||
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
|
|
||||||
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
|
|
||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||||
|
|||||||
5
helm/Chart.yaml
Normal file
5
helm/Chart.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: oc-shared
|
||||||
|
description: A Helm chart for deploying the oc-shared service
|
||||||
|
version: 0.1.0
|
||||||
|
appVersion: "1.0"
|
||||||
67
helm/README.md
Normal file
67
helm/README.md
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
# README.md - `oc-shared` Helm Chart
|
||||||
|
|
||||||
|
This document describes the different tags found in the `values.yml` file used in the Helm chart for the `oc-shared` component.
|
||||||
|
|
||||||
|
## Tags in the `values.yml` file
|
||||||
|
|
||||||
|
### `replicaCount`
|
||||||
|
- **Description**: Defines the number of replicas for the deployment. A replica represents an instance of the application that will be deployed.
|
||||||
|
- **Example**: `1` means a single instance of the `oc-shared` service will be deployed.
|
||||||
|
|
||||||
|
### `image.repository`
|
||||||
|
- **Description**: Specifies the URL of the Docker image registry where the `oc-shared` component image is stored.
|
||||||
|
- **Example**: `registry.dev.svc.cluster.local:5000/oc-shared` refers to a local registry hosted within the `cluster.local` network.
|
||||||
|
|
||||||
|
### `image.tag`
|
||||||
|
- **Description**: Indicates the tag of the Docker image to use. Typically, this could be a specific version or `latest` to always pull the latest version.
|
||||||
|
- **Example**: `latest` means the most recent version of the image will be used.
|
||||||
|
|
||||||
|
### `image.pullPolicy`
|
||||||
|
- **Description**: Defines the image pull policy. The possible options are:
|
||||||
|
- `Always`: Always pull the image.
|
||||||
|
- `IfNotPresent`: Pull the image only if it is not already present on the node.
|
||||||
|
- `Never`: Never pull the image.
|
||||||
|
- **Example**: `IfNotPresent` means the image will only be pulled if it is not already present on the node.
|
||||||
|
|
||||||
|
### `env.mongoDatabase`
|
||||||
|
- **Description**: Defines the name of the MongoDB database the application will connect to.
|
||||||
|
- **Example**: `DC_myDC` refers to the MongoDB database used by the application.
|
||||||
|
|
||||||
|
### `env.mongoUrl`
|
||||||
|
- **Description**: Specifies the connection URL for MongoDB used by the application.
|
||||||
|
- **Example**: `mongodb://toto:27017` indicates that the application will connect to the MongoDB instance hosted at `toto` on port `27017`.
|
||||||
|
|
||||||
|
### `service.type`
|
||||||
|
- **Description**: Defines the type of Kubernetes service. Possible types include:
|
||||||
|
- `ClusterIP`: The service is only accessible within the cluster.
|
||||||
|
- `NodePort`: The service is accessible via a specific port on all cluster nodes.
|
||||||
|
- `LoadBalancer`: The service is exposed via an external Load Balancer.
|
||||||
|
- **Example**: `ClusterIP` means the service will only be accessible within the Kubernetes cluster.
|
||||||
|
|
||||||
|
### `service.port`
|
||||||
|
- **Description**: Specifies the port on which the service will be exposed within the cluster.
|
||||||
|
- **Example**: `8091` means the service will be accessible on port `8091`.
|
||||||
|
|
||||||
|
### `service.targetPort`
|
||||||
|
- **Description**: Defines the port on which the application listens inside the container.
|
||||||
|
- **Example**: `8080` means the application listens on port `8080` within the container.
|
||||||
|
|
||||||
|
### `resources.limits.cpu`
|
||||||
|
- **Description**: Specifies the maximum amount of CPU (in millicores) allocated to the container.
|
||||||
|
- **Example**: `500m` means the container can use up to 0.5 CPU (or 50% of a full CPU core).
|
||||||
|
|
||||||
|
### `resources.limits.memory`
|
||||||
|
- **Description**: Specifies the maximum amount of memory (in MiB) allocated to the container.
|
||||||
|
- **Example**: `512Mi` means the container can use up to 512 MiB of memory.
|
||||||
|
|
||||||
|
### `resources.requests.cpu`
|
||||||
|
- **Description**: Defines the guaranteed amount of CPU (in millicores) for the container. Kubernetes will ensure this amount is always available.
|
||||||
|
- **Example**: `250m` means the container will have at least 0.25 CPU (or 25% of a full CPU core).
|
||||||
|
|
||||||
|
### `resources.requests.memory`
|
||||||
|
- **Description**: Defines the guaranteed amount of memory (in MiB) for the container. Kubernetes will reserve this memory for the container.
|
||||||
|
- **Example**: `256Mi` means the container will have at least 256 MiB of memory.
|
||||||
|
|
||||||
|
## Conclusion
|
||||||
|
|
||||||
|
This `values.yml` file allows configuring the deployment settings for the `oc-shared` component. Each tag plays a specific role in defining the Docker image, service configuration, and resource allocation for the container within the Kubernetes cluster.
|
||||||
7
helm/templates/configmap.yml
Normal file
7
helm/templates/configmap.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: oc-shared-configmap
|
||||||
|
data:
|
||||||
|
MONGO_DATABASE: "{{ .Values.env.mongoDatabase }}"
|
||||||
|
OCSHARED_MONGOURL: "{{ .Values.env.mongoUrl }}"
|
||||||
31
helm/templates/deployment.yml
Normal file
31
helm/templates/deployment.yml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: oc-shared
|
||||||
|
labels:
|
||||||
|
app: oc-shared
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: oc-shared
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: oc-shared
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: oc-shared
|
||||||
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ .Values.service.targetPort }}
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: oc-shared-configmap
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: "{{ .Values.resources.limits.cpu }}"
|
||||||
|
memory: "{{ .Values.resources.limits.memory }}"
|
||||||
|
requests:
|
||||||
|
cpu: "{{ .Values.resources.requests.cpu }}"
|
||||||
|
memory: "{{ .Values.resources.requests.memory }}"
|
||||||
16
helm/templates/service.yml
Normal file
16
helm/templates/service.yml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: oc-shared
|
||||||
|
labels:
|
||||||
|
app: oc-shared
|
||||||
|
release: {{ .Release.Name }}
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.service.type }} # Utilisation du type de service configuré (ClusterIP, NodePort, LoadBalancer)
|
||||||
|
selector:
|
||||||
|
app: oc-catalog
|
||||||
|
release: {{ .Release.Name }}
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: {{ .Values.service.port }} # Port exposé (8091 par défaut)
|
||||||
|
targetPort: {{ .Values.service.targetPort }} # Port du conteneur interne (8080 par défaut)
|
||||||
23
helm/values.yaml
Normal file
23
helm/values.yaml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
replicaCount: 1
|
||||||
|
|
||||||
|
image:
|
||||||
|
repository: registry.dev.svc.cluster.local:5000/oc-shared
|
||||||
|
tag: latest
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
env:
|
||||||
|
mongoDatabase: DC_myDC
|
||||||
|
mongoUrl: mongodb://toto:27017
|
||||||
|
|
||||||
|
service:
|
||||||
|
type: ClusterIP
|
||||||
|
port: 8091
|
||||||
|
targetPort: 8080
|
||||||
|
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: "500m"
|
||||||
|
memory: "512Mi"
|
||||||
|
requests:
|
||||||
|
cpu: "250m"
|
||||||
|
memory: "256Mi"
|
||||||
11
main.go
11
main.go
@@ -22,17 +22,22 @@ func main() {
|
|||||||
o.GetStringDefault("MONGO_URL", "mongodb://127.0.0.1:27017"),
|
o.GetStringDefault("MONGO_URL", "mongodb://127.0.0.1:27017"),
|
||||||
o.GetStringDefault("MONGO_DATABASE", "DC_myDC"),
|
o.GetStringDefault("MONGO_DATABASE", "DC_myDC"),
|
||||||
"",
|
"",
|
||||||
o.GetStringDefault("LOKI_URL", ""),
|
o.GetStringDefault("lokiurl", ""),
|
||||||
o.GetStringDefault("LOG_LEVEL", "info"),
|
o.GetStringDefault("loglevel", "info"),
|
||||||
)
|
)
|
||||||
|
|
||||||
/* PATHS ARE REFERENCE FOR INNER SERVICE OF DISTANT OC
|
/* PATHS ARE REFERENCE FOR INNER SERVICE OF DISTANT OC
|
||||||
* PATHS ARE USED TO CALL OTHER OC SERVICES
|
* PATHS ARE USED TO CALL OTHER OC SERVICES
|
||||||
* NAMES ARE CANONICAL NAMES OF THE SERVICES
|
* NAMES ARE CANONICAL NAMES OF THE SERVICES
|
||||||
*/
|
*/
|
||||||
|
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"))
|
||||||
|
|
||||||
// Beego init
|
// Beego init
|
||||||
beego.BConfig.AppName = appname
|
beego.BConfig.AppName = appname
|
||||||
beego.BConfig.Listen.HTTPPort = 8080
|
beego.BConfig.Listen.HTTPPort = o.GetIntDefault("port", 8080)
|
||||||
beego.BConfig.WebConfig.DirectoryIndex = true
|
beego.BConfig.WebConfig.DirectoryIndex = true
|
||||||
beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
|
beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"],
|
beego.GlobalControllerRouter["oc-shared/controllers:RuleController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:RuleController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "Post",
|
Method: "Post",
|
||||||
Router: `/`,
|
Router: `/`,
|
||||||
@@ -16,7 +16,7 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"],
|
beego.GlobalControllerRouter["oc-shared/controllers:RuleController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:RuleController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "GetAll",
|
Method: "GetAll",
|
||||||
Router: `/`,
|
Router: `/`,
|
||||||
@@ -25,7 +25,7 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"],
|
beego.GlobalControllerRouter["oc-shared/controllers:RuleController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:RuleController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "Put",
|
Method: "Put",
|
||||||
Router: `/:id`,
|
Router: `/:id`,
|
||||||
@@ -34,7 +34,7 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"],
|
beego.GlobalControllerRouter["oc-shared/controllers:RuleController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:RuleController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "Get",
|
Method: "Get",
|
||||||
Router: `/:id`,
|
Router: `/:id`,
|
||||||
@@ -43,7 +43,7 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"],
|
beego.GlobalControllerRouter["oc-shared/controllers:RuleController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:RuleController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "Delete",
|
Method: "Delete",
|
||||||
Router: `/:id`,
|
Router: `/:id`,
|
||||||
@@ -52,79 +52,7 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"],
|
beego.GlobalControllerRouter["oc-shared/controllers:RuleController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:RuleController"],
|
||||||
beego.ControllerComments{
|
|
||||||
Method: "AddPeer",
|
|
||||||
Router: `/:id/peer/:id2`,
|
|
||||||
AllowHTTPMethods: []string{"post"},
|
|
||||||
MethodParams: param.Make(),
|
|
||||||
Filters: nil,
|
|
||||||
Params: nil})
|
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"],
|
|
||||||
beego.ControllerComments{
|
|
||||||
Method: "RemovePeer",
|
|
||||||
Router: `/:id/peer/:id2`,
|
|
||||||
AllowHTTPMethods: []string{"delete"},
|
|
||||||
MethodParams: param.Make(),
|
|
||||||
Filters: nil,
|
|
||||||
Params: nil})
|
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"],
|
|
||||||
beego.ControllerComments{
|
|
||||||
Method: "AddRule",
|
|
||||||
Router: `/:id/rule/:id2`,
|
|
||||||
AllowHTTPMethods: []string{"post"},
|
|
||||||
MethodParams: param.Make(),
|
|
||||||
Filters: nil,
|
|
||||||
Params: nil})
|
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"],
|
|
||||||
beego.ControllerComments{
|
|
||||||
Method: "RemoveRule",
|
|
||||||
Router: `/:id/rule/:id2`,
|
|
||||||
AllowHTTPMethods: []string{"delete"},
|
|
||||||
MethodParams: param.Make(),
|
|
||||||
Filters: nil,
|
|
||||||
Params: nil})
|
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"],
|
|
||||||
beego.ControllerComments{
|
|
||||||
Method: "RemoveWorkflow",
|
|
||||||
Router: `/:id/workflow/:id2`,
|
|
||||||
AllowHTTPMethods: []string{"delete"},
|
|
||||||
MethodParams: param.Make(),
|
|
||||||
Filters: nil,
|
|
||||||
Params: nil})
|
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"],
|
|
||||||
beego.ControllerComments{
|
|
||||||
Method: "AddWorkflow",
|
|
||||||
Router: `/:id/workflow/:id2`,
|
|
||||||
AllowHTTPMethods: []string{"post"},
|
|
||||||
MethodParams: param.Make(),
|
|
||||||
Filters: nil,
|
|
||||||
Params: nil})
|
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"],
|
|
||||||
beego.ControllerComments{
|
|
||||||
Method: "AddWorkspace",
|
|
||||||
Router: `/:id/workspace/:id2`,
|
|
||||||
AllowHTTPMethods: []string{"post"},
|
|
||||||
MethodParams: param.Make(),
|
|
||||||
Filters: nil,
|
|
||||||
Params: nil})
|
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"],
|
|
||||||
beego.ControllerComments{
|
|
||||||
Method: "RemoveWorkspace",
|
|
||||||
Router: `/:id/workspace/:id2`,
|
|
||||||
AllowHTTPMethods: []string{"delete"},
|
|
||||||
MethodParams: param.Make(),
|
|
||||||
Filters: nil,
|
|
||||||
Params: nil})
|
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:CollaborativeAreaController"],
|
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "Search",
|
Method: "Search",
|
||||||
Router: `/search/:search`,
|
Router: `/search/:search`,
|
||||||
@@ -133,7 +61,7 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:RuleController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:RuleController"],
|
beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "Post",
|
Method: "Post",
|
||||||
Router: `/`,
|
Router: `/`,
|
||||||
@@ -142,7 +70,7 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:RuleController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:RuleController"],
|
beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "GetAll",
|
Method: "GetAll",
|
||||||
Router: `/`,
|
Router: `/`,
|
||||||
@@ -151,7 +79,7 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:RuleController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:RuleController"],
|
beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "Put",
|
Method: "Put",
|
||||||
Router: `/:id`,
|
Router: `/:id`,
|
||||||
@@ -160,7 +88,7 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:RuleController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:RuleController"],
|
beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "Get",
|
Method: "Get",
|
||||||
Router: `/:id`,
|
Router: `/:id`,
|
||||||
@@ -169,7 +97,7 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:RuleController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:RuleController"],
|
beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "Delete",
|
Method: "Delete",
|
||||||
Router: `/:id`,
|
Router: `/:id`,
|
||||||
@@ -178,7 +106,79 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["oc-shared/controllers:RuleController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:RuleController"],
|
beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"],
|
||||||
|
beego.ControllerComments{
|
||||||
|
Method: "AddPeer",
|
||||||
|
Router: `/:id/peer/:id2`,
|
||||||
|
AllowHTTPMethods: []string{"post"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
|
beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"],
|
||||||
|
beego.ControllerComments{
|
||||||
|
Method: "RemovePeer",
|
||||||
|
Router: `/:id/peer/:id2`,
|
||||||
|
AllowHTTPMethods: []string{"delete"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
|
beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"],
|
||||||
|
beego.ControllerComments{
|
||||||
|
Method: "AddRule",
|
||||||
|
Router: `/:id/rule/:id2`,
|
||||||
|
AllowHTTPMethods: []string{"post"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
|
beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"],
|
||||||
|
beego.ControllerComments{
|
||||||
|
Method: "RemoveRule",
|
||||||
|
Router: `/:id/rule/:id2`,
|
||||||
|
AllowHTTPMethods: []string{"delete"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
|
beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"],
|
||||||
|
beego.ControllerComments{
|
||||||
|
Method: "RemoveWorkflow",
|
||||||
|
Router: `/:id/workflow/:id2`,
|
||||||
|
AllowHTTPMethods: []string{"delete"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
|
beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"],
|
||||||
|
beego.ControllerComments{
|
||||||
|
Method: "AddWorkflow",
|
||||||
|
Router: `/:id/workflow/:id2`,
|
||||||
|
AllowHTTPMethods: []string{"post"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
|
beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"],
|
||||||
|
beego.ControllerComments{
|
||||||
|
Method: "AddWorkspace",
|
||||||
|
Router: `/:id/workspace/:id2`,
|
||||||
|
AllowHTTPMethods: []string{"post"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
|
beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"],
|
||||||
|
beego.ControllerComments{
|
||||||
|
Method: "RemoveWorkspace",
|
||||||
|
Router: `/:id/workspace/:id2`,
|
||||||
|
AllowHTTPMethods: []string{"delete"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
|
beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"] = append(beego.GlobalControllerRouter["oc-shared/controllers:SharedWorkspaceController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "Search",
|
Method: "Search",
|
||||||
Router: `/search/:search`,
|
Router: `/search/:search`,
|
||||||
|
|||||||
@@ -15,12 +15,12 @@ import (
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
ns := beego.NewNamespace("/oc",
|
ns := beego.NewNamespace("/oc",
|
||||||
beego.NSNamespace("/shared/collaborative_area",
|
beego.NSNamespace("/shared/workspace",
|
||||||
beego.NSInclude(
|
beego.NSInclude(
|
||||||
&controllers.CollaborativeAreaController{},
|
&controllers.SharedWorkspaceController{},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
beego.NSNamespace("/shared/collaborative_area/rule",
|
beego.NSNamespace("/shared/workspace/rule",
|
||||||
beego.NSInclude(
|
beego.NSInclude(
|
||||||
&controllers.RuleController{},
|
&controllers.RuleController{},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -15,13 +15,13 @@
|
|||||||
},
|
},
|
||||||
"basePath": "/oc",
|
"basePath": "/oc",
|
||||||
"paths": {
|
"paths": {
|
||||||
"/shared/collaborative_area/": {
|
"/shared/workspace/": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area"
|
"shared/workspace"
|
||||||
],
|
],
|
||||||
"description": "find shared workspace by id\n\u003cbr\u003e",
|
"description": "find shared workspace by id\n\u003cbr\u003e",
|
||||||
"operationId": "CollaborativeAreaController.GetAll",
|
"operationId": "SharedWorkspaceController.GetAll",
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "{shared_workspace} models.shared_workspace"
|
"description": "{shared_workspace} models.shared_workspace"
|
||||||
@@ -30,10 +30,10 @@
|
|||||||
},
|
},
|
||||||
"post": {
|
"post": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area"
|
"shared/workspace"
|
||||||
],
|
],
|
||||||
"description": "create shared workspace\n\u003cbr\u003e",
|
"description": "create shared workspace\n\u003cbr\u003e",
|
||||||
"operationId": "CollaborativeAreaController.Create",
|
"operationId": "SharedWorkspaceController.Create",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"in": "body",
|
"in": "body",
|
||||||
@@ -52,10 +52,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/shared/collaborative_area/rule/": {
|
"/shared/workspace/rule/": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area/rule"
|
"shared/workspace/rule"
|
||||||
],
|
],
|
||||||
"description": "find rule by id\n\u003cbr\u003e",
|
"description": "find rule by id\n\u003cbr\u003e",
|
||||||
"operationId": "RuleController.GetAll",
|
"operationId": "RuleController.GetAll",
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
},
|
},
|
||||||
"post": {
|
"post": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area/rule"
|
"shared/workspace/rule"
|
||||||
],
|
],
|
||||||
"description": "create rule\n\u003cbr\u003e",
|
"description": "create rule\n\u003cbr\u003e",
|
||||||
"operationId": "RuleController.Create",
|
"operationId": "RuleController.Create",
|
||||||
@@ -89,10 +89,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/shared/collaborative_area/rule/search/{search}": {
|
"/shared/workspace/rule/search/{search}": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area/rule"
|
"shared/workspace/rule"
|
||||||
],
|
],
|
||||||
"description": "search rule\n\u003cbr\u003e",
|
"description": "search rule\n\u003cbr\u003e",
|
||||||
"operationId": "RuleController.Search",
|
"operationId": "RuleController.Search",
|
||||||
@@ -112,10 +112,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/shared/collaborative_area/rule/{id}": {
|
"/shared/workspace/rule/{id}": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area/rule"
|
"shared/workspace/rule"
|
||||||
],
|
],
|
||||||
"description": "find rule by id\n\u003cbr\u003e",
|
"description": "find rule by id\n\u003cbr\u003e",
|
||||||
"operationId": "RuleController.Get",
|
"operationId": "RuleController.Get",
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
},
|
},
|
||||||
"put": {
|
"put": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area/rule"
|
"shared/workspace/rule"
|
||||||
],
|
],
|
||||||
"description": "create rules\n\u003cbr\u003e",
|
"description": "create rules\n\u003cbr\u003e",
|
||||||
"operationId": "RuleController.Update",
|
"operationId": "RuleController.Update",
|
||||||
@@ -166,7 +166,7 @@
|
|||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area/rule"
|
"shared/workspace/rule"
|
||||||
],
|
],
|
||||||
"description": "delete the rule\n\u003cbr\u003e",
|
"description": "delete the rule\n\u003cbr\u003e",
|
||||||
"operationId": "RuleController.Delete",
|
"operationId": "RuleController.Delete",
|
||||||
@@ -186,13 +186,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/shared/collaborative_area/search/{search}": {
|
"/shared/workspace/search/{search}": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area"
|
"shared/workspace"
|
||||||
],
|
],
|
||||||
"description": "search shared workspace\n\u003cbr\u003e",
|
"description": "search shared workspace\n\u003cbr\u003e",
|
||||||
"operationId": "CollaborativeAreaController.Search",
|
"operationId": "SharedWorkspaceController.Search",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"in": "path",
|
"in": "path",
|
||||||
@@ -209,13 +209,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/shared/collaborative_area/{id}": {
|
"/shared/workspace/{id}": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area"
|
"shared/workspace"
|
||||||
],
|
],
|
||||||
"description": "find shared workspace by id\n\u003cbr\u003e",
|
"description": "find shared workspace by id\n\u003cbr\u003e",
|
||||||
"operationId": "CollaborativeAreaController.Get",
|
"operationId": "SharedWorkspaceController.Get",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"in": "path",
|
"in": "path",
|
||||||
@@ -233,10 +233,10 @@
|
|||||||
},
|
},
|
||||||
"put": {
|
"put": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area"
|
"shared/workspace"
|
||||||
],
|
],
|
||||||
"description": "create shared workspaces\n\u003cbr\u003e",
|
"description": "create shared workspaces\n\u003cbr\u003e",
|
||||||
"operationId": "CollaborativeAreaController.Update",
|
"operationId": "SharedWorkspaceController.Update",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"in": "path",
|
"in": "path",
|
||||||
@@ -263,10 +263,10 @@
|
|||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area"
|
"shared/workspace"
|
||||||
],
|
],
|
||||||
"description": "delete the shared workspace\n\u003cbr\u003e",
|
"description": "delete the shared workspace\n\u003cbr\u003e",
|
||||||
"operationId": "CollaborativeAreaController.Delete",
|
"operationId": "SharedWorkspaceController.Delete",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"in": "path",
|
"in": "path",
|
||||||
@@ -283,13 +283,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/shared/collaborative_area/{id}/peer/{id2}": {
|
"/shared/workspace/{id}/peer/{id2}": {
|
||||||
"post": {
|
"post": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area"
|
"shared/workspace"
|
||||||
],
|
],
|
||||||
"description": "find shared workspace by id\n\u003cbr\u003e",
|
"description": "find shared workspace by id\n\u003cbr\u003e",
|
||||||
"operationId": "CollaborativeAreaController.Add Peer",
|
"operationId": "SharedWorkspaceController.Add Peer",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"in": "path",
|
"in": "path",
|
||||||
@@ -314,10 +314,10 @@
|
|||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area"
|
"shared/workspace"
|
||||||
],
|
],
|
||||||
"description": "find shared workspace by id\n\u003cbr\u003e",
|
"description": "find shared workspace by id\n\u003cbr\u003e",
|
||||||
"operationId": "CollaborativeAreaController.Remove Peer",
|
"operationId": "SharedWorkspaceController.Remove Peer",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"in": "path",
|
"in": "path",
|
||||||
@@ -341,13 +341,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/shared/collaborative_area/{id}/rule/{id2}": {
|
"/shared/workspace/{id}/rule/{id2}": {
|
||||||
"post": {
|
"post": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area"
|
"shared/workspace"
|
||||||
],
|
],
|
||||||
"description": "find shared workspace by id\n\u003cbr\u003e",
|
"description": "find shared workspace by id\n\u003cbr\u003e",
|
||||||
"operationId": "CollaborativeAreaController.Add Rule",
|
"operationId": "SharedWorkspaceController.Add Rule",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"in": "path",
|
"in": "path",
|
||||||
@@ -372,10 +372,10 @@
|
|||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area"
|
"shared/workspace"
|
||||||
],
|
],
|
||||||
"description": "find shared workspace by id\n\u003cbr\u003e",
|
"description": "find shared workspace by id\n\u003cbr\u003e",
|
||||||
"operationId": "CollaborativeAreaController.Remove Rule",
|
"operationId": "SharedWorkspaceController.Remove Rule",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"in": "path",
|
"in": "path",
|
||||||
@@ -399,13 +399,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/shared/collaborative_area/{id}/workflow/{id2}": {
|
"/shared/workspace/{id}/workflow/{id2}": {
|
||||||
"post": {
|
"post": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area"
|
"shared/workspace"
|
||||||
],
|
],
|
||||||
"description": "find shared workspace by id\n\u003cbr\u003e",
|
"description": "find shared workspace by id\n\u003cbr\u003e",
|
||||||
"operationId": "CollaborativeAreaController.Add Workflow",
|
"operationId": "SharedWorkspaceController.Add Workflow",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"in": "path",
|
"in": "path",
|
||||||
@@ -430,10 +430,10 @@
|
|||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area"
|
"shared/workspace"
|
||||||
],
|
],
|
||||||
"description": "find shared workspace by id\n\u003cbr\u003e",
|
"description": "find shared workspace by id\n\u003cbr\u003e",
|
||||||
"operationId": "CollaborativeAreaController.Remove Workflow",
|
"operationId": "SharedWorkspaceController.Remove Workflow",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"in": "path",
|
"in": "path",
|
||||||
@@ -457,13 +457,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/shared/collaborative_area/{id}/workspace/{id2}": {
|
"/shared/workspace/{id}/workspace/{id2}": {
|
||||||
"post": {
|
"post": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area"
|
"shared/workspace"
|
||||||
],
|
],
|
||||||
"description": "find shared workspace by id\n\u003cbr\u003e",
|
"description": "find shared workspace by id\n\u003cbr\u003e",
|
||||||
"operationId": "CollaborativeAreaController.Add Workspace",
|
"operationId": "SharedWorkspaceController.Add Workspace",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"in": "path",
|
"in": "path",
|
||||||
@@ -488,10 +488,10 @@
|
|||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"shared/collaborative_area"
|
"shared/workspace"
|
||||||
],
|
],
|
||||||
"description": "find shared workspace by id\n\u003cbr\u003e",
|
"description": "find shared workspace by id\n\u003cbr\u003e",
|
||||||
"operationId": "CollaborativeAreaController.Add Workspace",
|
"operationId": "SharedWorkspaceController.Add Workspace",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"in": "path",
|
"in": "path",
|
||||||
@@ -560,11 +560,11 @@
|
|||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
{
|
{
|
||||||
"name": "shared/collaborative_area",
|
"name": "shared/workspace",
|
||||||
"description": "Operations about workspace\n"
|
"description": "Operations about workspace\n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "shared/collaborative_area/rule",
|
"name": "shared/workspace/rule",
|
||||||
"description": "Operations about rule\n"
|
"description": "Operations about rule\n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,24 +12,24 @@ info:
|
|||||||
url: https://opensource.org/license/mit
|
url: https://opensource.org/license/mit
|
||||||
basePath: /oc
|
basePath: /oc
|
||||||
paths:
|
paths:
|
||||||
/shared/collaborative_area/:
|
/shared/workspace/:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area
|
- shared/workspace
|
||||||
description: |-
|
description: |-
|
||||||
find shared workspace by id
|
find shared workspace by id
|
||||||
<br>
|
<br>
|
||||||
operationId: CollaborativeAreaController.GetAll
|
operationId: SharedWorkspaceController.GetAll
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: '{shared_workspace} models.shared_workspace'
|
description: '{shared_workspace} models.shared_workspace'
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area
|
- shared/workspace
|
||||||
description: |-
|
description: |-
|
||||||
create shared workspace
|
create shared workspace
|
||||||
<br>
|
<br>
|
||||||
operationId: CollaborativeAreaController.Create
|
operationId: SharedWorkspaceController.Create
|
||||||
parameters:
|
parameters:
|
||||||
- in: body
|
- in: body
|
||||||
name: data
|
name: data
|
||||||
@@ -40,14 +40,14 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: '{shared workspace} models.shared_workspace'
|
description: '{shared workspace} models.shared_workspace'
|
||||||
/shared/collaborative_area/{id}:
|
/shared/workspace/{id}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area
|
- shared/workspace
|
||||||
description: |-
|
description: |-
|
||||||
find shared workspace by id
|
find shared workspace by id
|
||||||
<br>
|
<br>
|
||||||
operationId: CollaborativeAreaController.Get
|
operationId: SharedWorkspaceController.Get
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: id
|
name: id
|
||||||
@@ -59,11 +59,11 @@ paths:
|
|||||||
description: '{shared workspace} models.shared_workspace'
|
description: '{shared workspace} models.shared_workspace'
|
||||||
put:
|
put:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area
|
- shared/workspace
|
||||||
description: |-
|
description: |-
|
||||||
create shared workspaces
|
create shared workspaces
|
||||||
<br>
|
<br>
|
||||||
operationId: CollaborativeAreaController.Update
|
operationId: SharedWorkspaceController.Update
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: id
|
name: id
|
||||||
@@ -81,11 +81,11 @@ paths:
|
|||||||
description: '{shared workspace} models.shared_workspace'
|
description: '{shared workspace} models.shared_workspace'
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area
|
- shared/workspace
|
||||||
description: |-
|
description: |-
|
||||||
delete the shared workspace
|
delete the shared workspace
|
||||||
<br>
|
<br>
|
||||||
operationId: CollaborativeAreaController.Delete
|
operationId: SharedWorkspaceController.Delete
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: id
|
name: id
|
||||||
@@ -95,14 +95,14 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: '{shared workspace} delete success!'
|
description: '{shared workspace} delete success!'
|
||||||
/shared/collaborative_area/{id}/peer/{id2}:
|
/shared/workspace/{id}/peer/{id2}:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area
|
- shared/workspace
|
||||||
description: |-
|
description: |-
|
||||||
find shared workspace by id
|
find shared workspace by id
|
||||||
<br>
|
<br>
|
||||||
operationId: CollaborativeAreaController.Add Peer
|
operationId: SharedWorkspaceController.Add Peer
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: id
|
name: id
|
||||||
@@ -119,11 +119,11 @@ paths:
|
|||||||
description: '{shared workspace} models.shared_workspace'
|
description: '{shared workspace} models.shared_workspace'
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area
|
- shared/workspace
|
||||||
description: |-
|
description: |-
|
||||||
find shared workspace by id
|
find shared workspace by id
|
||||||
<br>
|
<br>
|
||||||
operationId: CollaborativeAreaController.Remove Peer
|
operationId: SharedWorkspaceController.Remove Peer
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: id
|
name: id
|
||||||
@@ -138,14 +138,14 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: '{shared workspace} models.shared_workspace'
|
description: '{shared workspace} models.shared_workspace'
|
||||||
/shared/collaborative_area/{id}/rule/{id2}:
|
/shared/workspace/{id}/rule/{id2}:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area
|
- shared/workspace
|
||||||
description: |-
|
description: |-
|
||||||
find shared workspace by id
|
find shared workspace by id
|
||||||
<br>
|
<br>
|
||||||
operationId: CollaborativeAreaController.Add Rule
|
operationId: SharedWorkspaceController.Add Rule
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: id
|
name: id
|
||||||
@@ -162,11 +162,11 @@ paths:
|
|||||||
description: '{shared workspace} models.shared_workspace'
|
description: '{shared workspace} models.shared_workspace'
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area
|
- shared/workspace
|
||||||
description: |-
|
description: |-
|
||||||
find shared workspace by id
|
find shared workspace by id
|
||||||
<br>
|
<br>
|
||||||
operationId: CollaborativeAreaController.Remove Rule
|
operationId: SharedWorkspaceController.Remove Rule
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: id
|
name: id
|
||||||
@@ -181,14 +181,14 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: '{shared workspace} models.shared_workspace'
|
description: '{shared workspace} models.shared_workspace'
|
||||||
/shared/collaborative_area/{id}/workflow/{id2}:
|
/shared/workspace/{id}/workflow/{id2}:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area
|
- shared/workspace
|
||||||
description: |-
|
description: |-
|
||||||
find shared workspace by id
|
find shared workspace by id
|
||||||
<br>
|
<br>
|
||||||
operationId: CollaborativeAreaController.Add Workflow
|
operationId: SharedWorkspaceController.Add Workflow
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: id
|
name: id
|
||||||
@@ -205,11 +205,11 @@ paths:
|
|||||||
description: '{shared workspace} models.shared_workspace'
|
description: '{shared workspace} models.shared_workspace'
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area
|
- shared/workspace
|
||||||
description: |-
|
description: |-
|
||||||
find shared workspace by id
|
find shared workspace by id
|
||||||
<br>
|
<br>
|
||||||
operationId: CollaborativeAreaController.Remove Workflow
|
operationId: SharedWorkspaceController.Remove Workflow
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: id
|
name: id
|
||||||
@@ -224,14 +224,14 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: '{shared workspace} models.shared_workspace'
|
description: '{shared workspace} models.shared_workspace'
|
||||||
/shared/collaborative_area/{id}/workspace/{id2}:
|
/shared/workspace/{id}/workspace/{id2}:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area
|
- shared/workspace
|
||||||
description: |-
|
description: |-
|
||||||
find shared workspace by id
|
find shared workspace by id
|
||||||
<br>
|
<br>
|
||||||
operationId: CollaborativeAreaController.Add Workspace
|
operationId: SharedWorkspaceController.Add Workspace
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: id
|
name: id
|
||||||
@@ -248,11 +248,11 @@ paths:
|
|||||||
description: '{shared workspace} models.shared_workspace'
|
description: '{shared workspace} models.shared_workspace'
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area
|
- shared/workspace
|
||||||
description: |-
|
description: |-
|
||||||
find shared workspace by id
|
find shared workspace by id
|
||||||
<br>
|
<br>
|
||||||
operationId: CollaborativeAreaController.Add Workspace
|
operationId: SharedWorkspaceController.Add Workspace
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: id
|
name: id
|
||||||
@@ -267,10 +267,10 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: '{shared workspace} models.shared_workspace'
|
description: '{shared workspace} models.shared_workspace'
|
||||||
/shared/collaborative_area/rule/:
|
/shared/workspace/rule/:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area/rule
|
- shared/workspace/rule
|
||||||
description: |-
|
description: |-
|
||||||
find rule by id
|
find rule by id
|
||||||
<br>
|
<br>
|
||||||
@@ -280,7 +280,7 @@ paths:
|
|||||||
description: '{rule} models.rule'
|
description: '{rule} models.rule'
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area/rule
|
- shared/workspace/rule
|
||||||
description: |-
|
description: |-
|
||||||
create rule
|
create rule
|
||||||
<br>
|
<br>
|
||||||
@@ -295,10 +295,10 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: '{rule} models.rule'
|
description: '{rule} models.rule'
|
||||||
/shared/collaborative_area/rule/{id}:
|
/shared/workspace/rule/{id}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area/rule
|
- shared/workspace/rule
|
||||||
description: |-
|
description: |-
|
||||||
find rule by id
|
find rule by id
|
||||||
<br>
|
<br>
|
||||||
@@ -314,7 +314,7 @@ paths:
|
|||||||
description: '{rule} models.rule'
|
description: '{rule} models.rule'
|
||||||
put:
|
put:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area/rule
|
- shared/workspace/rule
|
||||||
description: |-
|
description: |-
|
||||||
create rules
|
create rules
|
||||||
<br>
|
<br>
|
||||||
@@ -336,7 +336,7 @@ paths:
|
|||||||
description: '{rule} models.rule'
|
description: '{rule} models.rule'
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area/rule
|
- shared/workspace/rule
|
||||||
description: |-
|
description: |-
|
||||||
delete the rule
|
delete the rule
|
||||||
<br>
|
<br>
|
||||||
@@ -350,10 +350,10 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: '{rule} delete success!'
|
description: '{rule} delete success!'
|
||||||
/shared/collaborative_area/rule/search/{search}:
|
/shared/workspace/rule/search/{search}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area/rule
|
- shared/workspace/rule
|
||||||
description: |-
|
description: |-
|
||||||
search rule
|
search rule
|
||||||
<br>
|
<br>
|
||||||
@@ -367,14 +367,14 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: '{rule} models.rule'
|
description: '{rule} models.rule'
|
||||||
/shared/collaborative_area/search/{search}:
|
/shared/workspace/search/{search}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- shared/collaborative_area
|
- shared/workspace
|
||||||
description: |-
|
description: |-
|
||||||
search shared workspace
|
search shared workspace
|
||||||
<br>
|
<br>
|
||||||
operationId: CollaborativeAreaController.Search
|
operationId: SharedWorkspaceController.Search
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: search
|
name: search
|
||||||
@@ -417,10 +417,10 @@ definitions:
|
|||||||
title: workspace
|
title: workspace
|
||||||
type: object
|
type: object
|
||||||
tags:
|
tags:
|
||||||
- name: shared/collaborative_area
|
- name: shared/workspace
|
||||||
description: |
|
description: |
|
||||||
Operations about workspace
|
Operations about workspace
|
||||||
- name: shared/collaborative_area/rule
|
- name: shared/workspace/rule
|
||||||
description: |
|
description: |
|
||||||
Operations about rule
|
Operations about rule
|
||||||
- name: version
|
- name: version
|
||||||
|
|||||||
Reference in New Issue
Block a user