distributed research fully operationnal

This commit is contained in:
mr
2026-03-05 13:58:47 +01:00
parent dcd4bd497e
commit d8e3ca4c47
13 changed files with 305 additions and 267 deletions

View File

@@ -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)
}