diff --git a/controllers/compute.go b/controllers/compute.go index 0acbfac..ed88042 100755 --- a/controllers/compute.go +++ b/controllers/compute.go @@ -128,7 +128,7 @@ func (o *ComputeController) Delete() { // @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 /search/:search/decentralized/:type [get] +// @router /decentralized/:type/search/:search[get] func (o *ComputeController) SearchDecentralized() { user, _, _ := oclib.ExtractTokenInfo(*o.Ctx.Request) search := o.Ctx.Input.Param(":search") diff --git a/controllers/data.go b/controllers/data.go index 7692b17..cd46f90 100755 --- a/controllers/data.go +++ b/controllers/data.go @@ -129,7 +129,7 @@ func (o *DataController) Delete() { // @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 /search/:search/decentralized/:type [get] +// @router /decentralized/:type/search/:search[get] func (o *DataController) SearchDecentralized() { user, _, _ := oclib.ExtractTokenInfo(*o.Ctx.Request) search := o.Ctx.Input.Param(":search") diff --git a/controllers/processing.go b/controllers/processing.go index 94378f3..6bd48e4 100755 --- a/controllers/processing.go +++ b/controllers/processing.go @@ -128,7 +128,7 @@ func (o *ProcessingController) Delete() { // @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 /search/:search/decentralized/:type [get] +// @router /decentralized/:type/search/:search[get] func (o *ProcessingController) SearchDecentralized() { user, _, _ := oclib.ExtractTokenInfo(*o.Ctx.Request) search := o.Ctx.Input.Param(":search") diff --git a/controllers/resource.go b/controllers/resource.go index 9254e30..a93ee80 100755 --- a/controllers/resource.go +++ b/controllers/resource.go @@ -92,7 +92,7 @@ func (o *ResourceController) Get() { // @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 /search/:search/decentralized/:type [get] +// @router /decentralized/:type/search/:search [get] func (o *ResourceController) SearchDecentralized() { user, _, _ := oclib.ExtractTokenInfo(*o.Ctx.Request) search := o.Ctx.Input.Param(":search") diff --git a/controllers/storage.go b/controllers/storage.go index 17c8a32..ef697f2 100755 --- a/controllers/storage.go +++ b/controllers/storage.go @@ -128,7 +128,7 @@ func (o *StorageController) Delete() { // @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 /search/:search/decentralized/:type [get] +// @router /decentralized/:type/search/:search[get] func (o *StorageController) SearchDecentralized() { user, _, _ := oclib.ExtractTokenInfo(*o.Ctx.Request) search := o.Ctx.Input.Param(":search") diff --git a/controllers/workflow.go b/controllers/workflow.go index 067408e..632be39 100755 --- a/controllers/workflow.go +++ b/controllers/workflow.go @@ -95,7 +95,7 @@ func (o *WorkflowController) Search() { // @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 /search/:search/decentralized/:type [get] +// @router /decentralized/:type/search/:search[get] func (o *WorkflowController) SearchDecentralized() { user, _, _ := oclib.ExtractTokenInfo(*o.Ctx.Request) search := o.Ctx.Input.Param(":search") diff --git a/main.go b/main.go index d47b196..02f1780 100755 --- a/main.go +++ b/main.go @@ -13,6 +13,6 @@ const appname = "oc-catalog" func main() { // Init the oc-lib oclib.InitAPI(appname) - infrastructure.ListenNATS() + go infrastructure.ListenNATS() beego.Run() } diff --git a/oc-catalog b/oc-catalog index cd3af16..cefc9da 100755 Binary files a/oc-catalog and b/oc-catalog differ diff --git a/routers/commentsRouter.go b/routers/commentsRouter.go index 8005cb4..21e58ee 100755 --- a/routers/commentsRouter.go +++ b/routers/commentsRouter.go @@ -52,6 +52,15 @@ func init() { Filters: nil, Params: nil}) + beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"], + beego.ControllerComments{ + Method: "SearchDecentralized", + Router: `/decentralized/:type/search/:search[get]`, + AllowHTTPMethods: []string{"get"}, + MethodParams: param.Make(), + Filters: nil, + Params: nil}) + beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"], beego.ControllerComments{ Method: "Search", @@ -106,6 +115,15 @@ func init() { Filters: nil, Params: nil}) + beego.GlobalControllerRouter["oc-catalog/controllers:DataController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:DataController"], + beego.ControllerComments{ + Method: "SearchDecentralized", + Router: `/decentralized/:type/search/:search[get]`, + AllowHTTPMethods: []string{"get"}, + MethodParams: param.Make(), + Filters: nil, + Params: nil}) + beego.GlobalControllerRouter["oc-catalog/controllers:DataController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:DataController"], beego.ControllerComments{ Method: "Search", @@ -286,6 +304,15 @@ func init() { Filters: nil, Params: nil}) + beego.GlobalControllerRouter["oc-catalog/controllers:ProcessingController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ProcessingController"], + beego.ControllerComments{ + Method: "SearchDecentralized", + Router: `/decentralized/:type/search/:search[get]`, + AllowHTTPMethods: []string{"get"}, + MethodParams: param.Make(), + Filters: nil, + Params: nil}) + beego.GlobalControllerRouter["oc-catalog/controllers:ProcessingController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ProcessingController"], beego.ControllerComments{ Method: "Search", @@ -351,9 +378,9 @@ func init() { beego.GlobalControllerRouter["oc-catalog/controllers:ResourceController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ResourceController"], beego.ControllerComments{ - Method: "Delete", - Router: `/:id`, - AllowHTTPMethods: []string{"delete"}, + Method: "SearchDecentralized", + Router: `/decentralized/:type/search/:search`, + AllowHTTPMethods: []string{"get"}, MethodParams: param.Make(), Filters: nil, Params: nil}) @@ -412,6 +439,15 @@ func init() { Filters: nil, Params: nil}) + beego.GlobalControllerRouter["oc-catalog/controllers:StorageController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:StorageController"], + beego.ControllerComments{ + Method: "SearchDecentralized", + Router: `/decentralized/:type/search/:search[get]`, + AllowHTTPMethods: []string{"get"}, + MethodParams: param.Make(), + Filters: nil, + Params: nil}) + beego.GlobalControllerRouter["oc-catalog/controllers:StorageController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:StorageController"], beego.ControllerComments{ Method: "Search", @@ -484,6 +520,15 @@ func init() { Filters: nil, Params: nil}) + beego.GlobalControllerRouter["oc-catalog/controllers:WorkflowController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:WorkflowController"], + beego.ControllerComments{ + Method: "SearchDecentralized", + Router: `/decentralized/:type/search/:search[get]`, + AllowHTTPMethods: []string{"get"}, + MethodParams: param.Make(), + Filters: nil, + Params: nil}) + beego.GlobalControllerRouter["oc-catalog/controllers:WorkflowController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:WorkflowController"], beego.ControllerComments{ Method: "Search", diff --git a/swagger/index.html b/swagger/index.html index 2a9d4e2..9df41b1 100644 --- a/swagger/index.html +++ b/swagger/index.html @@ -39,7 +39,7 @@ window.onload = function() { // Begin Swagger UI call region const ui = SwaggerUIBundle({ - url: "https://petstore.swagger.io/v2/swagger.json", + url: "swagger.json", dom_id: '#swagger-ui', deepLinking: true, presets: [ diff --git a/swagger/swagger.json b/swagger/swagger.json index d19c6b9..cac83a8 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -89,6 +89,35 @@ } } }, + "/compute/search/{search}/decentralized/{type}": { + "get": { + "tags": [ + "compute" + ], + "description": "find workflow by key word\n\u003cbr\u003e", + "operationId": "ComputeController.Search Decentralized", + "parameters": [ + { + "in": "path", + "name": "search", + "description": "the search you want to get", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "is_draft", + "description": "draft wished", + "type": "string" + } + ], + "responses": { + "200": { + "description": "{workflow} models.workflow" + } + } + } + }, "/compute/{id}": { "get": { "tags": [ @@ -220,6 +249,35 @@ } } }, + "/data/search/{search}/decentralized/{type}": { + "get": { + "tags": [ + "data" + ], + "description": "find workflow by key word\n\u003cbr\u003e", + "operationId": "DataController.Search Decentralized", + "parameters": [ + { + "in": "path", + "name": "search", + "description": "the search you want to get", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "is_draft", + "description": "draft wished", + "type": "string" + } + ], + "responses": { + "200": { + "description": "{workflow} models.workflow" + } + } + } + }, "/data/{id}": { "get": { "tags": [ @@ -576,6 +634,35 @@ } } }, + "/processing/search/{search}/decentralized/{type}": { + "get": { + "tags": [ + "processing" + ], + "description": "find workflow by key word\n\u003cbr\u003e", + "operationId": "ProcessingController.Search Decentralized", + "parameters": [ + { + "in": "path", + "name": "search", + "description": "the search you want to get", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "is_draft", + "description": "draft wished", + "type": "string" + } + ], + "responses": { + "200": { + "description": "{workflow} models.workflow" + } + } + } + }, "/processing/{id}": { "get": { "tags": [ @@ -769,6 +856,35 @@ } } }, + "/resource/decentralized/{type}/search/{search}": { + "get": { + "tags": [ + "resource" + ], + "description": "find workflow by key word\n\u003cbr\u003e", + "operationId": "ResourceController.Search Decentralized", + "parameters": [ + { + "in": "path", + "name": "search", + "description": "the search you want to get", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "is_draft", + "description": "draft wished", + "type": "string" + } + ], + "responses": { + "200": { + "description": "{workflow} models.workflow" + } + } + } + }, "/resource/search/{search}": { "get": { "tags": [ @@ -819,27 +935,6 @@ "description": "{resource} models.resource" } } - }, - "delete": { - "tags": [ - "resource" - ], - "description": "delete the resource\n\u003cbr\u003e", - "operationId": "ResourceController.Delete", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "The id you want to deleteDeleteOne", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "{resource} delete success!" - } - } } }, "/storage/": { @@ -916,6 +1011,35 @@ } } }, + "/storage/search/{search}/decentralized/{type}": { + "get": { + "tags": [ + "storage" + ], + "description": "find workflow by key word\n\u003cbr\u003e", + "operationId": "StorageController.Search Decentralized", + "parameters": [ + { + "in": "path", + "name": "search", + "description": "the search you want to get", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "is_draft", + "description": "draft wished", + "type": "string" + } + ], + "responses": { + "200": { + "description": "{workflow} models.workflow" + } + } + } + }, "/storage/{id}": { "get": { "tags": [ @@ -1069,7 +1193,36 @@ "workflow" ], "description": "find workflow by key word\n\u003cbr\u003e", - "operationId": "WorkflowController.Get", + "operationId": "WorkflowController.Search", + "parameters": [ + { + "in": "path", + "name": "search", + "description": "the search you want to get", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "is_draft", + "description": "draft wished", + "type": "string" + } + ], + "responses": { + "200": { + "description": "{workflow} models.workflow" + } + } + } + }, + "/workflow/search/{search}/decentralized/{type}": { + "get": { + "tags": [ + "workflow" + ], + "description": "find workflow by key word\n\u003cbr\u003e", + "operationId": "WorkflowController.Search Decentralized", "parameters": [ { "in": "path", diff --git a/swagger/swagger.yml b/swagger/swagger.yml index e39496e..a230905 100644 --- a/swagger/swagger.yml +++ b/swagger/swagger.yml @@ -121,6 +121,27 @@ paths: responses: "200": description: '{compute} models.compute' + /compute/search/{search}/decentralized/{type}: + get: + tags: + - compute + description: |- + find workflow by key word +
+ operationId: ComputeController.Search Decentralized + parameters: + - in: path + name: search + description: the search you want to get + required: true + type: string + - in: query + name: is_draft + description: draft wished + type: string + responses: + "200": + description: '{workflow} models.workflow' /data/: get: tags: @@ -216,6 +237,27 @@ paths: responses: "200": description: '{data} models.data' + /data/search/{search}/decentralized/{type}: + get: + tags: + - data + description: |- + find workflow by key word +
+ operationId: DataController.Search Decentralized + parameters: + - in: path + name: search + description: the search you want to get + required: true + type: string + - in: query + name: is_draft + description: draft wished + type: string + responses: + "200": + description: '{workflow} models.workflow' /enum/booking/status: get: tags: @@ -487,6 +529,27 @@ paths: responses: "200": description: '{processing} models.processing' + /processing/search/{search}/decentralized/{type}: + get: + tags: + - processing + description: |- + find workflow by key word +
+ operationId: ProcessingController.Search Decentralized + parameters: + - in: path + name: search + description: the search you want to get + required: true + type: string + - in: query + name: is_draft + description: draft wished + type: string + responses: + "200": + description: '{workflow} models.workflow' /purchase/: get: tags: @@ -591,22 +654,27 @@ paths: responses: "200": description: '{resource} models.resource' - delete: + /resource/decentralized/{type}/search/{search}: + get: tags: - resource description: |- - delete the resource + find workflow by key word
- operationId: ResourceController.Delete + operationId: ResourceController.Search Decentralized parameters: - in: path - name: id - description: The id you want to deleteDeleteOne + name: search + description: the search you want to get required: true type: string + - in: query + name: is_draft + description: draft wished + type: string responses: "200": - description: '{resource} delete success!' + description: '{workflow} models.workflow' /resource/search/{search}: get: tags: @@ -737,6 +805,27 @@ paths: responses: "200": description: '{storage} models.storage' + /storage/search/{search}/decentralized/{type}: + get: + tags: + - storage + description: |- + find workflow by key word +
+ operationId: StorageController.Search Decentralized + parameters: + - in: path + name: search + description: the search you want to get + required: true + type: string + - in: query + name: is_draft + description: draft wished + type: string + responses: + "200": + description: '{workflow} models.workflow' /version/: get: tags: @@ -854,7 +943,28 @@ paths: description: |- find workflow by key word
- operationId: WorkflowController.Get + operationId: WorkflowController.Search + parameters: + - in: path + name: search + description: the search you want to get + required: true + type: string + - in: query + name: is_draft + description: draft wished + type: string + responses: + "200": + description: '{workflow} models.workflow' + /workflow/search/{search}/decentralized/{type}: + get: + tags: + - workflow + description: |- + find workflow by key word +
+ operationId: WorkflowController.Search Decentralized parameters: - in: path name: search