distributed research fully operationnal
This commit is contained in:
@@ -122,34 +122,3 @@ func (o *StorageController) Delete() {
|
||||
o.Data["json"] = data
|
||||
o.ServeJSON()
|
||||
}
|
||||
|
||||
// @Title Search Decentralized
|
||||
// @Description find workflow by key word
|
||||
// @Param search path string true "the search you want to get"
|
||||
// @Param is_draft query string false "draft wished"
|
||||
// @Success 200 {workflow} models.workflow
|
||||
// @router /decentralized/:type/search/:search[get]
|
||||
func (o *StorageController) SearchDecentralized() {
|
||||
user, _, _ := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
||||
search := o.Ctx.Input.Param(":search")
|
||||
t := o.Ctx.Input.Param(":type")
|
||||
b, err := json.Marshal(map[string]string{
|
||||
"search": search,
|
||||
"type": t,
|
||||
})
|
||||
infrastructure.EmitNATS(user, tools.PropalgationMessage{
|
||||
Action: tools.PB_SEARCH,
|
||||
DataType: storage_dt.EnumIndex(),
|
||||
Payload: b,
|
||||
})
|
||||
if err != nil {
|
||||
o.Data["json"] = map[string]interface{}{
|
||||
"data": nil,
|
||||
"code": 400,
|
||||
"error": err,
|
||||
}
|
||||
o.ServeJSON()
|
||||
return
|
||||
}
|
||||
Websocket(o.Ctx.Request.Context(), user, o.Ctx.ResponseWriter, o.Ctx.Request)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user