add groups
This commit is contained in:
@@ -24,7 +24,7 @@ var comp_dt = tools.COMPUTE_RESOURCE
|
||||
// @Success 200 {compute} models.compute
|
||||
// @router /:id [put]
|
||||
func (o *ComputeController) Put() {
|
||||
user, _, _ := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
||||
user, _, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
||||
// store and return Id or post with UUID
|
||||
var res map[string]interface{}
|
||||
id := o.Ctx.Input.Param(":id")
|
||||
@@ -32,7 +32,7 @@ func (o *ComputeController) Put() {
|
||||
data := oclib.NewRequestAdmin(comp_collection, nil).UpdateOne(res, id)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
Action: tools.PB_UPDATE,
|
||||
DataType: comp_dt.EnumIndex(),
|
||||
Payload: data,
|
||||
@@ -54,7 +54,7 @@ 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(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
Action: tools.PB_CREATE,
|
||||
DataType: comp_dt.EnumIndex(),
|
||||
Payload: data,
|
||||
@@ -113,7 +113,7 @@ 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(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
Action: tools.PB_DELETE,
|
||||
DataType: comp_dt.EnumIndex(),
|
||||
Payload: data,
|
||||
|
||||
@@ -32,7 +32,7 @@ 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(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
Action: tools.PB_UPDATE,
|
||||
DataType: data_dt.EnumIndex(),
|
||||
Payload: data,
|
||||
@@ -54,7 +54,7 @@ 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(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
Action: tools.PB_CREATE,
|
||||
DataType: data_dt.EnumIndex(),
|
||||
Payload: data,
|
||||
@@ -114,7 +114,7 @@ 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(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
Action: tools.PB_DELETE,
|
||||
DataType: data_dt.EnumIndex(),
|
||||
Payload: data,
|
||||
|
||||
@@ -26,7 +26,7 @@ var processing_dt = tools.PROCESSING_RESOURCE
|
||||
// @router /:id [put]
|
||||
func (o *ProcessingController) Put() {
|
||||
// store and return Id or post with UUID
|
||||
user, _, _ := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
||||
user, _, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
||||
var res map[string]interface{}
|
||||
id := o.Ctx.Input.Param(":id")
|
||||
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
|
||||
@@ -34,7 +34,7 @@ func (o *ProcessingController) Put() {
|
||||
data := oclib.NewRequestAdmin(processing_collection, nil).UpdateOne(res, id)
|
||||
if data.Err == "" {
|
||||
data, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
Action: tools.PB_UPDATE,
|
||||
DataType: processing_dt.EnumIndex(),
|
||||
Payload: data,
|
||||
@@ -56,7 +56,7 @@ 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(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
Action: tools.PB_CREATE,
|
||||
DataType: processing_dt.EnumIndex(),
|
||||
Payload: data,
|
||||
@@ -115,7 +115,7 @@ 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(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
Action: tools.PB_DELETE,
|
||||
DataType: processing_dt.EnumIndex(),
|
||||
Payload: data,
|
||||
|
||||
@@ -32,7 +32,7 @@ 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(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
Action: tools.PB_UPDATE,
|
||||
DataType: storage_dt.EnumIndex(),
|
||||
Payload: data,
|
||||
@@ -54,7 +54,7 @@ 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(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
Action: tools.PB_CREATE,
|
||||
DataType: storage_dt.EnumIndex(),
|
||||
Payload: data,
|
||||
@@ -113,7 +113,7 @@ 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(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
Action: tools.PB_DELETE,
|
||||
DataType: storage_dt.EnumIndex(),
|
||||
Payload: data,
|
||||
|
||||
@@ -32,7 +32,7 @@ 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(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
Action: tools.PB_UPDATE,
|
||||
Payload: data,
|
||||
DataType: workflow_dt.EnumIndex(),
|
||||
@@ -54,7 +54,7 @@ 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(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
Action: tools.PB_CREATE,
|
||||
DataType: workflow_dt.EnumIndex(),
|
||||
Payload: data,
|
||||
@@ -113,7 +113,7 @@ 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(user, tools.PropalgationMessage{
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
DataType: workflow_dt.EnumIndex(),
|
||||
Action: tools.PB_DELETE,
|
||||
Payload: data,
|
||||
|
||||
Reference in New Issue
Block a user