Compare commits
No commits in common. "47eb681f3b6c1cd53e04db68c5eff37c77156700" and "f56a5d0dd3cad12e2bde65bb056011aa6120e364" have entirely different histories.
47eb681f3b
...
f56a5d0dd3
@ -6,7 +6,6 @@ import (
|
|||||||
"slices"
|
"slices"
|
||||||
|
|
||||||
oclib "cloud.o-forge.io/core/oc-lib"
|
oclib "cloud.o-forge.io/core/oc-lib"
|
||||||
"cloud.o-forge.io/core/oc-lib/config"
|
|
||||||
"cloud.o-forge.io/core/oc-lib/tools"
|
"cloud.o-forge.io/core/oc-lib/tools"
|
||||||
beego "github.com/beego/beego/v2/server/web"
|
beego "github.com/beego/beego/v2/server/web"
|
||||||
)
|
)
|
||||||
@ -37,15 +36,12 @@ var paths = map[tools.DataType]map[tools.METHOD]string{ // paths used to call ot
|
|||||||
// @Title Search
|
// @Title Search
|
||||||
// @Description search shared workspace
|
// @Description search shared workspace
|
||||||
// @Param search path string true "the word search you want to get"
|
// @Param search path string true "the word search you want to get"
|
||||||
// @Param is_draft query string false "draft wished"
|
|
||||||
// @Success 200 {shared workspace} models.shared_workspace
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
// @router /search/:search [get]
|
// @router /search/:search [get]
|
||||||
func (o *CollaborativeAreaController) Search() {
|
func (o *CollaborativeAreaController) Search() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
// store and return Id or post with UUID
|
// store and return Id or post with UUID
|
||||||
search := o.Ctx.Input.Param(":search")
|
search := o.Ctx.Input.Param(":search")
|
||||||
isDraft := o.Ctx.Input.Query("is_draft")
|
o.Data["json"] = oclib.Search(nil, search, oclib.LibDataEnum(tools.COLLABORATIVE_AREA))
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, nil).Search(nil, search, isDraft == "true")
|
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +52,6 @@ func (o *CollaborativeAreaController) Search() {
|
|||||||
// @Success 200 {shared workspace} models.shared_workspace
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
// @router /:id [put]
|
// @router /:id [put]
|
||||||
func (o *CollaborativeAreaController) Put() {
|
func (o *CollaborativeAreaController) Put() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
// store and return Id or post with UUID
|
// store and return Id or post with UUID
|
||||||
var res map[string]interface{}
|
var res map[string]interface{}
|
||||||
id := o.Ctx.Input.Param(":id")
|
id := o.Ctx.Input.Param(":id")
|
||||||
@ -64,7 +59,7 @@ func (o *CollaborativeAreaController) Put() {
|
|||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
||||||
fmt.Println("UPDATE", res)
|
fmt.Println("UPDATE", res)
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, caller).UpdateOne(res, id)
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), res, id, caller)
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,24 +69,20 @@ func (o *CollaborativeAreaController) Put() {
|
|||||||
// @Success 200 {shared workspace} models.shared_workspace
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
// @router / [post]
|
// @router / [post]
|
||||||
func (o *CollaborativeAreaController) Post() {
|
func (o *CollaborativeAreaController) Post() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
||||||
var res map[string]interface{}
|
var res map[string]interface{}
|
||||||
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
|
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, caller).StoreOne(res)
|
o.Data["json"] = oclib.StoreOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), res, caller)
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Title GetAll
|
// @Title GetAll
|
||||||
// @Description find shared workspace by id
|
// @Description find shared workspace by id
|
||||||
// @Param is_draft query string false "draft wished"
|
|
||||||
// @Success 200 {shared_workspace} models.shared_workspace
|
// @Success 200 {shared_workspace} models.shared_workspace
|
||||||
// @router / [get]
|
// @router / [get]
|
||||||
func (o *CollaborativeAreaController) GetAll() {
|
func (o *CollaborativeAreaController) GetAll() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
o.Data["json"] = oclib.LoadAll(oclib.LibDataEnum(tools.COLLABORATIVE_AREA))
|
||||||
isDraft := o.Ctx.Input.Query("is_draft")
|
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, nil).LoadAll(isDraft == "true")
|
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,9 +92,8 @@ func (o *CollaborativeAreaController) GetAll() {
|
|||||||
// @Success 200 {shared workspace} models.shared_workspace
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
// @router /:id [get]
|
// @router /:id [get]
|
||||||
func (o *CollaborativeAreaController) Get() {
|
func (o *CollaborativeAreaController) Get() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
id := o.Ctx.Input.Param(":id")
|
id := o.Ctx.Input.Param(":id")
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, nil).LoadOne(id)
|
o.Data["json"] = oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,12 +104,11 @@ func (o *CollaborativeAreaController) Get() {
|
|||||||
// @Success 200 {shared workspace} models.shared_workspace
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
// @router /:id/workspace/:id2 [delete]
|
// @router /:id/workspace/:id2 [delete]
|
||||||
func (o *CollaborativeAreaController) RemoveWorkspace() {
|
func (o *CollaborativeAreaController) RemoveWorkspace() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
||||||
id := o.Ctx.Input.Param(":id")
|
id := o.Ctx.Input.Param(":id")
|
||||||
id2 := o.Ctx.Input.Param(":id2")
|
id2 := o.Ctx.Input.Param(":id2")
|
||||||
r := oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, nil).LoadOne(id)
|
r := oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
||||||
shared := r.ToCollaborativeArea()
|
shared := r.ToCollaborativeArea()
|
||||||
newWorkspace := []string{}
|
newWorkspace := []string{}
|
||||||
if slices.Contains(shared.Workspaces, id2) {
|
if slices.Contains(shared.Workspaces, id2) {
|
||||||
@ -130,8 +119,7 @@ func (o *CollaborativeAreaController) RemoveWorkspace() {
|
|||||||
}
|
}
|
||||||
shared.Workspaces = newWorkspace
|
shared.Workspaces = newWorkspace
|
||||||
}
|
}
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, caller).UpdateOne(
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), shared.Serialize(), id, caller)
|
||||||
shared.Serialize(shared), id)
|
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,12 +130,11 @@ func (o *CollaborativeAreaController) RemoveWorkspace() {
|
|||||||
// @Success 200 {shared workspace} models.shared_workspace
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
// @router /:id/workflow/:id2 [delete]
|
// @router /:id/workflow/:id2 [delete]
|
||||||
func (o *CollaborativeAreaController) RemoveWorkflow() {
|
func (o *CollaborativeAreaController) RemoveWorkflow() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
||||||
id := o.Ctx.Input.Param(":id")
|
id := o.Ctx.Input.Param(":id")
|
||||||
id2 := o.Ctx.Input.Param(":id2")
|
id2 := o.Ctx.Input.Param(":id2")
|
||||||
r := oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, nil).LoadOne(id)
|
r := oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
||||||
shared := r.ToCollaborativeArea()
|
shared := r.ToCollaborativeArea()
|
||||||
newWorkflows := []string{}
|
newWorkflows := []string{}
|
||||||
for _, w := range shared.Workflows {
|
for _, w := range shared.Workflows {
|
||||||
@ -156,8 +143,7 @@ func (o *CollaborativeAreaController) RemoveWorkflow() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
shared.Workflows = newWorkflows
|
shared.Workflows = newWorkflows
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, caller).UpdateOne(
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), shared.Serialize(), id, caller)
|
||||||
shared.Serialize(shared), id)
|
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,15 +154,14 @@ func (o *CollaborativeAreaController) RemoveWorkflow() {
|
|||||||
// @Success 200 {shared workspace} models.shared_workspace
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
// @router /:id/peer/:id2 [delete]
|
// @router /:id/peer/:id2 [delete]
|
||||||
func (o *CollaborativeAreaController) RemovePeer() {
|
func (o *CollaborativeAreaController) RemovePeer() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
||||||
id := o.Ctx.Input.Param(":id")
|
id := o.Ctx.Input.Param(":id")
|
||||||
id2 := o.Ctx.Input.Param(":id2")
|
id2 := o.Ctx.Input.Param(":id2")
|
||||||
r := oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, nil).LoadOne(id)
|
r := oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
||||||
shared := r.ToCollaborativeArea()
|
shared := r.ToCollaborativeArea()
|
||||||
newPeers := map[string][]string{}
|
newPeers := []string{}
|
||||||
if shared.CreatorID == id2 {
|
if shared.CreatorID != id2 {
|
||||||
o.Data["json"] = map[string]interface{}{
|
o.Data["json"] = map[string]interface{}{
|
||||||
"data": nil,
|
"data": nil,
|
||||||
"code": 409,
|
"code": 409,
|
||||||
@ -185,28 +170,15 @@ func (o *CollaborativeAreaController) RemovePeer() {
|
|||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if shared.AllowedPeersGroup != nil {
|
if slices.Contains(shared.Peers, id) && shared.CreatorID != id2 {
|
||||||
keys := make([]string, len(shared.AllowedPeersGroup))
|
for _, peer := range shared.Peers {
|
||||||
i := 0
|
if peer != id2 {
|
||||||
for k := range shared.AllowedPeersGroup {
|
newPeers = append(newPeers, peer)
|
||||||
keys[i] = k
|
|
||||||
i++
|
|
||||||
}
|
|
||||||
if slices.Contains(keys, id) && shared.CreatorID != id2 {
|
|
||||||
for _, peer := range keys {
|
|
||||||
if peer != id2 {
|
|
||||||
if config.GetConfig().Whitelist {
|
|
||||||
newPeers[peer] = []string{"*"}
|
|
||||||
} else {
|
|
||||||
newPeers[peer] = []string{}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
shared.AllowedPeersGroup = newPeers
|
|
||||||
}
|
}
|
||||||
|
shared.Peers = newPeers
|
||||||
}
|
}
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, caller).UpdateOne(
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), shared.Serialize(), id, caller)
|
||||||
shared.Serialize(shared), id)
|
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,12 +189,11 @@ func (o *CollaborativeAreaController) RemovePeer() {
|
|||||||
// @Success 200 {shared workspace} models.shared_workspace
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
// @router /:id/rule/:id2 [delete]
|
// @router /:id/rule/:id2 [delete]
|
||||||
func (o *CollaborativeAreaController) RemoveRule() {
|
func (o *CollaborativeAreaController) RemoveRule() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
||||||
id := o.Ctx.Input.Param(":id")
|
id := o.Ctx.Input.Param(":id")
|
||||||
id2 := o.Ctx.Input.Param(":id2")
|
id2 := o.Ctx.Input.Param(":id2")
|
||||||
r := oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, nil).LoadOne(id)
|
r := oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
||||||
shared := r.ToCollaborativeArea()
|
shared := r.ToCollaborativeArea()
|
||||||
newRules := []string{}
|
newRules := []string{}
|
||||||
if shared != nil && slices.Contains(shared.Rules, id2) {
|
if shared != nil && slices.Contains(shared.Rules, id2) {
|
||||||
@ -233,8 +204,7 @@ func (o *CollaborativeAreaController) RemoveRule() {
|
|||||||
}
|
}
|
||||||
shared.Rules = newRules
|
shared.Rules = newRules
|
||||||
}
|
}
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, caller).UpdateOne(
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), shared.Serialize(), id, caller)
|
||||||
shared.Serialize(shared), id)
|
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,12 +215,11 @@ func (o *CollaborativeAreaController) RemoveRule() {
|
|||||||
// @Success 200 {shared workspace} models.shared_workspace
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
// @router /:id/workspace/:id2 [post]
|
// @router /:id/workspace/:id2 [post]
|
||||||
func (o *CollaborativeAreaController) AddWorkspace() {
|
func (o *CollaborativeAreaController) AddWorkspace() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
||||||
id := o.Ctx.Input.Param(":id")
|
id := o.Ctx.Input.Param(":id")
|
||||||
id2 := o.Ctx.Input.Param(":id2")
|
id2 := o.Ctx.Input.Param(":id2")
|
||||||
r := oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, nil).LoadOne(id)
|
r := oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
||||||
if r.Code != 200 {
|
if r.Code != 200 {
|
||||||
o.Data["json"] = r
|
o.Data["json"] = r
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
@ -260,8 +229,7 @@ func (o *CollaborativeAreaController) AddWorkspace() {
|
|||||||
if shared != nil && !slices.Contains(shared.Workspaces, id2) {
|
if shared != nil && !slices.Contains(shared.Workspaces, id2) {
|
||||||
shared.Workspaces = append(shared.Workspaces, id2)
|
shared.Workspaces = append(shared.Workspaces, id2)
|
||||||
}
|
}
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, caller).UpdateOne(
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), shared.Serialize(), id, caller)
|
||||||
shared.Serialize(shared), id)
|
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,23 +240,16 @@ func (o *CollaborativeAreaController) AddWorkspace() {
|
|||||||
// @Success 200 {shared workspace} models.shared_workspace
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
// @router /:id/workflow/:id2 [post]
|
// @router /:id/workflow/:id2 [post]
|
||||||
func (o *CollaborativeAreaController) AddWorkflow() {
|
func (o *CollaborativeAreaController) AddWorkflow() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
||||||
id := o.Ctx.Input.Param(":id")
|
id := o.Ctx.Input.Param(":id")
|
||||||
id2 := o.Ctx.Input.Param(":id2")
|
id2 := o.Ctx.Input.Param(":id2")
|
||||||
r := oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, nil).LoadOne(id)
|
r := oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
||||||
if r.Code != 200 {
|
|
||||||
o.Data["json"] = r
|
|
||||||
o.ServeJSON()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
shared := r.ToCollaborativeArea()
|
shared := r.ToCollaborativeArea()
|
||||||
if shared != nil && !slices.Contains(shared.Workflows, id2) {
|
if shared != nil && !slices.Contains(shared.Workflows, id2) {
|
||||||
shared.Workflows = append(shared.Workflows, id2)
|
shared.Workflows = append(shared.Workflows, id2)
|
||||||
}
|
}
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, caller).UpdateOne(
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), shared.Serialize(), id, caller)
|
||||||
shared.Serialize(shared), id)
|
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,29 +257,19 @@ func (o *CollaborativeAreaController) AddWorkflow() {
|
|||||||
// @Description find shared workspace by id
|
// @Description find shared workspace by id
|
||||||
// @Param id path string true "the id you want to get"
|
// @Param id path string true "the id you want to get"
|
||||||
// @Param id2 path string true "the id you want to add"
|
// @Param id2 path string true "the id you want to add"
|
||||||
// @Param body body models.workspace true "The shared workspace content"
|
|
||||||
// @Success 200 {shared workspace} models.shared_workspace
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
// @router /:id/peer/:id2 [post]
|
// @router /:id/peer/:id2 [post]
|
||||||
func (o *CollaborativeAreaController) AddPeer() {
|
func (o *CollaborativeAreaController) AddPeer() {
|
||||||
var res []string
|
|
||||||
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
|
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
||||||
id := o.Ctx.Input.Param(":id")
|
id := o.Ctx.Input.Param(":id")
|
||||||
id2 := o.Ctx.Input.Param(":id2")
|
id2 := o.Ctx.Input.Param(":id2")
|
||||||
r := oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, nil).LoadOne(id)
|
r := oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
||||||
shared := r.ToCollaborativeArea()
|
shared := r.ToCollaborativeArea()
|
||||||
if shared.AllowedPeersGroup == nil {
|
if shared != nil && !slices.Contains(shared.Peers, id2) {
|
||||||
shared.AllowedPeersGroup = map[string][]string{}
|
shared.Peers = append(shared.Peers, id2)
|
||||||
}
|
}
|
||||||
if config.GetConfig().Whitelist && len(res) == 0 {
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), shared.Serialize(), id, caller)
|
||||||
shared.AllowedPeersGroup[id2] = []string{"*"}
|
|
||||||
} else {
|
|
||||||
shared.AllowedPeersGroup[id2] = res
|
|
||||||
}
|
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, caller).UpdateOne(
|
|
||||||
shared.Serialize(shared), id)
|
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -329,17 +280,16 @@ func (o *CollaborativeAreaController) AddPeer() {
|
|||||||
// @Success 200 {shared workspace} models.shared_workspace
|
// @Success 200 {shared workspace} models.shared_workspace
|
||||||
// @router /:id/rule/:id2 [post]
|
// @router /:id/rule/:id2 [post]
|
||||||
func (o *CollaborativeAreaController) AddRule() {
|
func (o *CollaborativeAreaController) AddRule() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
||||||
id := o.Ctx.Input.Param(":id")
|
id := o.Ctx.Input.Param(":id")
|
||||||
id2 := o.Ctx.Input.Param(":id2")
|
id2 := o.Ctx.Input.Param(":id2")
|
||||||
r := oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, nil).LoadOne(id)
|
r := oclib.LoadOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id)
|
||||||
shared := r.ToCollaborativeArea()
|
shared := r.ToCollaborativeArea()
|
||||||
if shared != nil && !slices.Contains(shared.Rules, id2) {
|
if shared != nil && !slices.Contains(shared.Rules, id2) {
|
||||||
shared.Rules = append(shared.Rules, id2)
|
shared.Rules = append(shared.Rules, id2)
|
||||||
}
|
}
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, caller).UpdateOne(shared.Serialize(shared), id)
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), shared.Serialize(), id, caller)
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,10 +299,9 @@ func (o *CollaborativeAreaController) AddRule() {
|
|||||||
// @Success 200 {shared workspace} delete success!
|
// @Success 200 {shared workspace} delete success!
|
||||||
// @router /:id [delete]
|
// @router /:id [delete]
|
||||||
func (o *CollaborativeAreaController) Delete() {
|
func (o *CollaborativeAreaController) Delete() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
id := o.Ctx.Input.Param(":id")
|
id := o.Ctx.Input.Param(":id")
|
||||||
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
caller := tools.NewHTTPCaller(paths) // caller used to send to peers
|
||||||
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
caller.Disabled = oclib.IsQueryParamsEquals(o.Ctx.Input, "is_remote", true)
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.COLLABORATIVE_AREA), user, peerID, groups, caller).DeleteOne(id)
|
o.Data["json"] = oclib.DeleteOne(oclib.LibDataEnum(tools.COLLABORATIVE_AREA), id, caller)
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
@ -15,15 +15,12 @@ type RuleController struct {
|
|||||||
// @Title Search
|
// @Title Search
|
||||||
// @Description search rule
|
// @Description search rule
|
||||||
// @Param search path string true "the word search you want to get"
|
// @Param search path string true "the word search you want to get"
|
||||||
// @Param is_draft query string false "draft wished"
|
|
||||||
// @Success 200 {rule} models.rule
|
// @Success 200 {rule} models.rule
|
||||||
// @router /search/:search [get]
|
// @router /search/:search [get]
|
||||||
func (o *RuleController) Search() {
|
func (o *RuleController) Search() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
// store and return Id or post with UUID
|
// store and return Id or post with UUID
|
||||||
search := o.Ctx.Input.Param(":search")
|
search := o.Ctx.Input.Param(":search")
|
||||||
isDraft := o.Ctx.Input.Query("is_draft")
|
o.Data["json"] = oclib.Search(nil, search, oclib.LibDataEnum(oclib.RULE))
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.RULE), user, peerID, groups, nil).Search(nil, search, isDraft == "true")
|
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,12 +31,11 @@ func (o *RuleController) Search() {
|
|||||||
// @Success 200 {rule} models.rule
|
// @Success 200 {rule} models.rule
|
||||||
// @router /:id [put]
|
// @router /:id [put]
|
||||||
func (o *RuleController) Put() {
|
func (o *RuleController) Put() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
// store and return ID or post with UUID
|
// store and return ID or post with UUID
|
||||||
var res map[string]interface{}
|
var res map[string]interface{}
|
||||||
id := o.Ctx.Input.Param(":id")
|
id := o.Ctx.Input.Param(":id")
|
||||||
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
|
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.RULE), user, peerID, groups, nil).UpdateOne(res, id)
|
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(oclib.RULE), res, id)
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,22 +45,18 @@ func (o *RuleController) Put() {
|
|||||||
// @Success 200 {rule} models.rule
|
// @Success 200 {rule} models.rule
|
||||||
// @router / [post]
|
// @router / [post]
|
||||||
func (o *RuleController) Post() {
|
func (o *RuleController) Post() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
var res map[string]interface{}
|
var res map[string]interface{}
|
||||||
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
|
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.RULE), user, peerID, groups, nil).StoreOne(res)
|
o.Data["json"] = oclib.StoreOne(oclib.LibDataEnum(oclib.RULE), res)
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Title GetAll
|
// @Title GetAll
|
||||||
// @Description find rule by id
|
// @Description find rule by id
|
||||||
// @Param is_draft query string false "draft wished"
|
|
||||||
// @Success 200 {rule} models.rule
|
// @Success 200 {rule} models.rule
|
||||||
// @router / [get]
|
// @router / [get]
|
||||||
func (o *RuleController) GetAll() {
|
func (o *RuleController) GetAll() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
o.Data["json"] = oclib.LoadAll(oclib.LibDataEnum(oclib.RULE))
|
||||||
isDraft := o.Ctx.Input.Query("is_draft")
|
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.RULE), user, peerID, groups, nil).LoadAll(isDraft == "true")
|
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,9 +66,8 @@ func (o *RuleController) GetAll() {
|
|||||||
// @Success 200 {rule} models.rule
|
// @Success 200 {rule} models.rule
|
||||||
// @router /:id [get]
|
// @router /:id [get]
|
||||||
func (o *RuleController) Get() {
|
func (o *RuleController) Get() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
id := o.Ctx.Input.Param(":id")
|
id := o.Ctx.Input.Param(":id")
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.RULE), user, peerID, groups, nil).LoadOne(id)
|
o.Data["json"] = oclib.LoadOne(oclib.LibDataEnum(oclib.RULE), id)
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,8 +77,7 @@ func (o *RuleController) Get() {
|
|||||||
// @Success 200 {rule} delete success!
|
// @Success 200 {rule} delete success!
|
||||||
// @router /:id [delete]
|
// @router /:id [delete]
|
||||||
func (o *RuleController) Delete() {
|
func (o *RuleController) Delete() {
|
||||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
|
||||||
id := o.Ctx.Input.Param(":id")
|
id := o.Ctx.Input.Param(":id")
|
||||||
o.Data["json"] = oclib.NewRequest(oclib.LibDataEnum(oclib.RULE), user, peerID, groups, nil).DeleteOne(id)
|
o.Data["json"] = oclib.DeleteOne(oclib.LibDataEnum(oclib.RULE), id)
|
||||||
o.ServeJSON()
|
o.ServeJSON()
|
||||||
}
|
}
|
||||||
|
7
go.mod
7
go.mod
@ -5,13 +5,12 @@ go 1.22.0
|
|||||||
toolchain go1.22.4
|
toolchain go1.22.4
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.o-forge.io/core/oc-lib v0.0.0-20250205160221-88b7cfe2fd0f
|
cloud.o-forge.io/core/oc-lib v0.0.0-20250108155542-0f4adeea86be
|
||||||
github.com/beego/beego/v2 v2.3.1
|
github.com/beego/beego/v2 v2.3.4
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/biter777/countries v1.7.5 // indirect
|
|
||||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||||
github.com/gabriel-vasile/mimetype v1.4.6 // indirect
|
github.com/gabriel-vasile/mimetype v1.4.6 // indirect
|
||||||
@ -38,7 +37,7 @@ require (
|
|||||||
github.com/prometheus/client_model v0.6.1 // indirect
|
github.com/prometheus/client_model v0.6.1 // indirect
|
||||||
github.com/prometheus/common v0.60.1 // indirect
|
github.com/prometheus/common v0.60.1 // indirect
|
||||||
github.com/prometheus/procfs v0.15.1 // indirect
|
github.com/prometheus/procfs v0.15.1 // indirect
|
||||||
github.com/robfig/cron v1.2.0 // indirect
|
github.com/robfig/cron/v3 v3.0.1 // indirect
|
||||||
github.com/rogpeppe/go-internal v1.11.0 // indirect
|
github.com/rogpeppe/go-internal v1.11.0 // indirect
|
||||||
github.com/rs/zerolog v1.33.0 // indirect
|
github.com/rs/zerolog v1.33.0 // indirect
|
||||||
github.com/shiena/ansicolor v0.0.0-20230509054315-a9deabde6e02 // indirect
|
github.com/shiena/ansicolor v0.0.0-20230509054315-a9deabde6e02 // indirect
|
||||||
|
12
go.sum
12
go.sum
@ -1,12 +1,12 @@
|
|||||||
cloud.o-forge.io/core/oc-lib v0.0.0-20250205160221-88b7cfe2fd0f h1:6V+Z81ywYoDYSVMnM4PVaJYXFgCN3xSG3ddiUPn4jL8=
|
cloud.o-forge.io/core/oc-lib v0.0.0-20250108155542-0f4adeea86be h1:1Yf8ihUxXjOEPqcfgtXJpJ/slxBUHhf7AgS7DZI3iUk=
|
||||||
cloud.o-forge.io/core/oc-lib v0.0.0-20250205160221-88b7cfe2fd0f/go.mod h1:2roQbUpv3a6mTIr5oU1ux31WbN8YucyyQvCQ0FqwbcE=
|
cloud.o-forge.io/core/oc-lib v0.0.0-20250108155542-0f4adeea86be/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo=
|
||||||
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.1 h1:7MUKMpJYzOXtCUsTEoXOxsDV/UcHw6CPbaWMlthVNsc=
|
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/beego/beego/v2 v2.3.1/go.mod h1:5cqHsOHJIxkq44tBpRvtDe59GuVRVv/9/tyVDxd5ce4=
|
||||||
|
github.com/beego/beego/v2 v2.3.4 h1:HurQEOGIEhLlPFCTR6ZDuQkybrUl2Ag2i6CdVD2rGiI=
|
||||||
|
github.com/beego/beego/v2 v2.3.4/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/biter777/countries v1.7.5 h1:MJ+n3+rSxWQdqVJU8eBy9RqcdH6ePPn4PJHocVWUa+Q=
|
|
||||||
github.com/biter777/countries v1.7.5/go.mod h1:1HSpZ526mYqKJcpT5Ti1kcGQ0L0SrXWIaptUWjFfv2E=
|
|
||||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||||
github.com/coreos/etcd v3.3.17+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
github.com/coreos/etcd v3.3.17+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||||
@ -97,8 +97,8 @@ github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPA
|
|||||||
github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw=
|
github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw=
|
||||||
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
|
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
|
||||||
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
|
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
|
||||||
github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
|
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
|
||||||
github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
|
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
|
||||||
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
|
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
|
||||||
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
|
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
|
||||||
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
||||||
|
@ -22,14 +22,6 @@
|
|||||||
],
|
],
|
||||||
"description": "find shared workspace by id\n\u003cbr\u003e",
|
"description": "find shared workspace by id\n\u003cbr\u003e",
|
||||||
"operationId": "CollaborativeAreaController.GetAll",
|
"operationId": "CollaborativeAreaController.GetAll",
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "is_draft",
|
|
||||||
"description": "draft wished",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "{shared_workspace} models.shared_workspace"
|
"description": "{shared_workspace} models.shared_workspace"
|
||||||
@ -74,12 +66,6 @@
|
|||||||
"description": "the word search you want to get",
|
"description": "the word search you want to get",
|
||||||
"required": true,
|
"required": true,
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "is_draft",
|
|
||||||
"description": "draft wished",
|
|
||||||
"type": "string"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@ -184,15 +170,6 @@
|
|||||||
"description": "the id you want to add",
|
"description": "the id you want to add",
|
||||||
"required": true,
|
"required": true,
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "body",
|
|
||||||
"name": "body",
|
|
||||||
"description": "The shared workspace content",
|
|
||||||
"required": true,
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/models.workspace"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@ -380,7 +357,7 @@
|
|||||||
"collaborative_area"
|
"collaborative_area"
|
||||||
],
|
],
|
||||||
"description": "find shared workspace by id\n\u003cbr\u003e",
|
"description": "find shared workspace by id\n\u003cbr\u003e",
|
||||||
"operationId": "CollaborativeAreaController.Remove Workspace",
|
"operationId": "CollaborativeAreaController.Add Workspace",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"in": "path",
|
"in": "path",
|
||||||
|
@ -20,11 +20,6 @@ paths:
|
|||||||
find shared workspace by id
|
find shared workspace by id
|
||||||
<br>
|
<br>
|
||||||
operationId: CollaborativeAreaController.GetAll
|
operationId: CollaborativeAreaController.GetAll
|
||||||
parameters:
|
|
||||||
- in: query
|
|
||||||
name: is_draft
|
|
||||||
description: draft wished
|
|
||||||
type: string
|
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: '{shared_workspace} models.shared_workspace'
|
description: '{shared_workspace} models.shared_workspace'
|
||||||
@ -119,12 +114,6 @@ paths:
|
|||||||
description: the id you want to add
|
description: the id you want to add
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
- in: body
|
|
||||||
name: body
|
|
||||||
description: The shared workspace content
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/models.workspace'
|
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: '{shared workspace} models.shared_workspace'
|
description: '{shared workspace} models.shared_workspace'
|
||||||
@ -263,7 +252,7 @@ paths:
|
|||||||
description: |-
|
description: |-
|
||||||
find shared workspace by id
|
find shared workspace by id
|
||||||
<br>
|
<br>
|
||||||
operationId: CollaborativeAreaController.Remove Workspace
|
operationId: CollaborativeAreaController.Add Workspace
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: id
|
name: id
|
||||||
@ -292,10 +281,6 @@ paths:
|
|||||||
description: the word search you want to get
|
description: the word search you want to get
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
- in: query
|
|
||||||
name: is_draft
|
|
||||||
description: draft wished
|
|
||||||
type: string
|
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: '{shared workspace} models.shared_workspace'
|
description: '{shared workspace} models.shared_workspace'
|
||||||
|
Loading…
Reference in New Issue
Block a user