Change User
This commit is contained in:
@@ -32,10 +32,9 @@ func (o *ComputeController) Put() {
|
||||
data := oclib.NewRequest(comp_collection, user, peerID, groups, nil).UpdateOne(res, id)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_UPDATE,
|
||||
DataType: comp_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: data,
|
||||
})
|
||||
}
|
||||
@@ -55,10 +54,9 @@ func (o *ComputeController) Post() {
|
||||
data := oclib.NewRequest(comp_collection, user, peerID, groups, nil).StoreOne(res)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_CREATE,
|
||||
DataType: comp_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: data,
|
||||
})
|
||||
}
|
||||
@@ -115,10 +113,9 @@ func (o *ComputeController) Delete() {
|
||||
data := oclib.NewRequest(comp_collection, user, peerID, groups, nil).DeleteOne(id)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_DELETE,
|
||||
DataType: comp_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: data,
|
||||
})
|
||||
}
|
||||
@@ -140,10 +137,9 @@ func (o *ComputeController) SearchDecentralized() {
|
||||
"search": search,
|
||||
"type": t,
|
||||
})
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_SEARCH,
|
||||
DataType: comp_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: b,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -32,10 +32,9 @@ func (o *DataController) Put() {
|
||||
data := oclib.NewRequest(data_collection, user, peerID, groups, nil).UpdateOne(res, id)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_UPDATE,
|
||||
DataType: data_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: data,
|
||||
})
|
||||
}
|
||||
@@ -55,10 +54,9 @@ func (o *DataController) Post() {
|
||||
data := oclib.NewRequest(data_collection, user, peerID, groups, nil).StoreOne(res)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_CREATE,
|
||||
DataType: data_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: data,
|
||||
})
|
||||
}
|
||||
@@ -116,10 +114,9 @@ func (o *DataController) Delete() {
|
||||
data := oclib.NewRequest(data_collection, user, peerID, groups, nil).DeleteOne(id)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_DELETE,
|
||||
DataType: data_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: data,
|
||||
})
|
||||
}
|
||||
@@ -141,10 +138,9 @@ func (o *DataController) SearchDecentralized() {
|
||||
"search": search,
|
||||
"type": t,
|
||||
})
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_SEARCH,
|
||||
DataType: data_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: b,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -32,10 +32,9 @@ func (o *ProcessingController) Put() {
|
||||
data := oclib.NewRequest(processing_collection, user, peerID, groups, nil).UpdateOne(res, id)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_UPDATE,
|
||||
DataType: processing_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: data,
|
||||
})
|
||||
}
|
||||
@@ -55,10 +54,9 @@ func (o *ProcessingController) Post() {
|
||||
data := oclib.NewRequest(processing_collection, user, peerID, groups, nil).StoreOne(res)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_CREATE,
|
||||
DataType: processing_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: data,
|
||||
})
|
||||
}
|
||||
@@ -115,10 +113,9 @@ func (o *ProcessingController) Delete() {
|
||||
data := oclib.NewRequest(processing_collection, user, peerID, groups, nil).DeleteOne(id)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_DELETE,
|
||||
DataType: processing_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: data,
|
||||
})
|
||||
}
|
||||
@@ -140,10 +137,9 @@ func (o *ProcessingController) SearchDecentralized() {
|
||||
"search": search,
|
||||
"type": t,
|
||||
})
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_SEARCH,
|
||||
DataType: processing_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: b,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -101,10 +101,9 @@ func (o *ResourceController) SearchDecentralized() {
|
||||
"search": search,
|
||||
"type": t,
|
||||
})
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_SEARCH,
|
||||
DataType: -1,
|
||||
User: user,
|
||||
Payload: b,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -32,10 +32,9 @@ func (o *StorageController) Put() {
|
||||
data := oclib.NewRequest(storage_collection, user, peerID, groups, nil).UpdateOne(res, id)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_UPDATE,
|
||||
DataType: storage_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: data,
|
||||
})
|
||||
}
|
||||
@@ -55,10 +54,9 @@ func (o *StorageController) Post() {
|
||||
data := oclib.NewRequest(storage_collection, user, peerID, groups, nil).StoreOne(res)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_CREATE,
|
||||
DataType: storage_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: data,
|
||||
})
|
||||
}
|
||||
@@ -115,10 +113,9 @@ func (o *StorageController) Delete() {
|
||||
data := oclib.NewRequest(storage_collection, user, peerID, groups, nil).DeleteOne(id)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_DELETE,
|
||||
DataType: storage_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: data,
|
||||
})
|
||||
}
|
||||
@@ -140,10 +137,9 @@ func (o *StorageController) SearchDecentralized() {
|
||||
"search": search,
|
||||
"type": t,
|
||||
})
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_SEARCH,
|
||||
DataType: storage_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: b,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -32,11 +32,10 @@ func (o *WorkflowController) Put() {
|
||||
data := oclib.NewRequest(workflow_collection, user, peerID, groups, nil).UpdateOne(res, id)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_UPDATE,
|
||||
Payload: data,
|
||||
DataType: workflow_dt.EnumIndex(),
|
||||
User: user,
|
||||
})
|
||||
}
|
||||
o.Data["json"] = data
|
||||
@@ -55,10 +54,9 @@ func (o *WorkflowController) Post() {
|
||||
data := oclib.NewRequest(workflow_collection, user, peerID, groups, nil).StoreOne(res)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_CREATE,
|
||||
DataType: workflow_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: data,
|
||||
})
|
||||
}
|
||||
@@ -115,10 +113,9 @@ func (o *WorkflowController) SearchDecentralized() {
|
||||
o.ServeJSON()
|
||||
return
|
||||
}
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_SEARCH,
|
||||
DataType: workflow_dt.EnumIndex(),
|
||||
User: user,
|
||||
Payload: b,
|
||||
})
|
||||
Websocket(o.Ctx.Request.Context(), user, o.Ctx.ResponseWriter, o.Ctx.Request)
|
||||
@@ -147,10 +144,9 @@ func (o *WorkflowController) Delete() {
|
||||
data := oclib.NewRequest(workflow_collection, user, peerID, groups, nil).DeleteOne(id)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
DataType: workflow_dt.EnumIndex(),
|
||||
Action: tools.PB_DELETE,
|
||||
User: user,
|
||||
Payload: data,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user