From f64d02a1759906df7ea637913df1f4eec93811c7 Mon Sep 17 00:00:00 2001 From: liujiandao <274878379@qq.com> Date: 星期五, 24 十一月 2023 14:57:58 +0800 Subject: [PATCH] 查询指定操作详情 --- controllers/operation.go | 23 +++++ docs/swagger.yaml | 42 ++++++++++ docs/docs.go | 68 +++++++++++++++++ docs/swagger.json | 66 ++++++++++++++++ router/router.go | 1 5 files changed, 200 insertions(+), 0 deletions(-) diff --git a/controllers/operation.go b/controllers/operation.go index c0b34f4..aafdf87 100644 --- a/controllers/operation.go +++ b/controllers/operation.go @@ -172,6 +172,29 @@ return nil } +// GetOperationInfo +// @Tags 鍏ュ簱/鍑哄簱 +// @Summary 鍏ュ簱/鍑哄簱鍒楄〃 +// @Produce application/json +// +// @Param number path string true "鍗曞彿" +// +// @Success 200 {object} util.Response "鎴愬姛" +// @Router /api-wms/v1/operation/getOperationInfo/{number} [post] +func (slf OperationController) GetOperationInfo(c *gin.Context) { + number := c.Param("number") + if number == "" { + util.ResponseFormat(c, code.RequestParamError, "鍙傛暟瑙f瀽澶辫触锛屽弬鏁颁笉鑳戒负绌�") + return + } + operation, err := models.NewOperationSearch().SetNumber(number).SetPreload(true).First() + if err != nil { + util.ResponseFormat(c, code.RequestParamError, err.Error()) + return + } + util.ResponseFormat(c, code.Success, operation) +} + // List // @Tags 鍏ュ簱/鍑哄簱 // @Summary 鍏ュ簱/鍑哄簱鍒楄〃 diff --git a/docs/docs.go b/docs/docs.go index 477c6e3..de21b37 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1097,6 +1097,25 @@ } } }, + "/api-wms/v1/operation/getClientList": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "鍏ュ簱/鍑哄簱" + ], + "summary": "鑾峰彇鐗╂祦鍏徃鍒楄〃", + "responses": { + "200": { + "description": "鎴愬姛", + "schema": { + "$ref": "#/definitions/util.Response" + } + } + } + } + }, "/api-wms/v1/operation/getLogisticCompanyList": { "get": { "produces": [ @@ -1126,6 +1145,53 @@ } } ] + } + } + } + } + }, + "/api-wms/v1/operation/getOperationInfo/{number}": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "鍏ュ簱/鍑哄簱" + ], + "summary": "鍏ュ簱/鍑哄簱鍒楄〃", + "parameters": [ + { + "type": "string", + "description": "鍗曞彿", + "name": "number", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "鎴愬姛", + "schema": { + "$ref": "#/definitions/util.Response" + } + } + } + } + }, + "/api-wms/v1/operation/getSupplierList": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "鍏ュ簱/鍑哄簱" + ], + "summary": "鑾峰彇鐗╂祦鍏徃鍒楄〃", + "responses": { + "200": { + "description": "鎴愬姛", + "schema": { + "$ref": "#/definitions/util.Response" } } } @@ -4716,6 +4782,8 @@ Description: "", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, + LeftDelim: "{{", + RightDelim: "}}", } func init() { diff --git a/docs/swagger.json b/docs/swagger.json index aff7979..3f31871 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1085,6 +1085,25 @@ } } }, + "/api-wms/v1/operation/getClientList": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "鍏ュ簱/鍑哄簱" + ], + "summary": "鑾峰彇鐗╂祦鍏徃鍒楄〃", + "responses": { + "200": { + "description": "鎴愬姛", + "schema": { + "$ref": "#/definitions/util.Response" + } + } + } + } + }, "/api-wms/v1/operation/getLogisticCompanyList": { "get": { "produces": [ @@ -1119,6 +1138,53 @@ } } }, + "/api-wms/v1/operation/getOperationInfo/{number}": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "鍏ュ簱/鍑哄簱" + ], + "summary": "鍏ュ簱/鍑哄簱鍒楄〃", + "parameters": [ + { + "type": "string", + "description": "鍗曞彿", + "name": "number", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "鎴愬姛", + "schema": { + "$ref": "#/definitions/util.Response" + } + } + } + } + }, + "/api-wms/v1/operation/getSupplierList": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "鍏ュ簱/鍑哄簱" + ], + "summary": "鑾峰彇鐗╂祦鍏徃鍒楄〃", + "responses": { + "200": { + "description": "鎴愬姛", + "schema": { + "$ref": "#/definitions/util.Response" + } + } + } + } + }, "/api-wms/v1/operation/list": { "post": { "produces": [ diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 667604e..8660f8a 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -2261,6 +2261,18 @@ summary: 鏇存敼璁板綍鐘舵�� tags: - 鍏ュ簱/鍑哄簱 + /api-wms/v1/operation/getClientList: + get: + produces: + - application/json + responses: + "200": + description: 鎴愬姛 + schema: + $ref: '#/definitions/util.Response' + summary: 鑾峰彇鐗╂祦鍏徃鍒楄〃 + tags: + - 鍏ュ簱/鍑哄簱 /api-wms/v1/operation/getLogisticCompanyList: get: produces: @@ -2280,6 +2292,36 @@ summary: 鑾峰彇鐗╂祦鍏徃鍒楄〃 tags: - 鍏ュ簱/鍑哄簱 + /api-wms/v1/operation/getOperationInfo/{number}: + post: + parameters: + - description: 鍗曞彿 + in: path + name: number + required: true + type: string + produces: + - application/json + responses: + "200": + description: 鎴愬姛 + schema: + $ref: '#/definitions/util.Response' + summary: 鍏ュ簱/鍑哄簱鍒楄〃 + tags: + - 鍏ュ簱/鍑哄簱 + /api-wms/v1/operation/getSupplierList: + get: + produces: + - application/json + responses: + "200": + description: 鎴愬姛 + schema: + $ref: '#/definitions/util.Response' + summary: 鑾峰彇鐗╂祦鍏徃鍒楄〃 + tags: + - 鍏ュ簱/鍑哄簱 /api-wms/v1/operation/list: post: parameters: diff --git a/router/router.go b/router/router.go index bef5f29..0064c33 100644 --- a/router/router.go +++ b/router/router.go @@ -81,6 +81,7 @@ operationAPI := r.Group(urlPrefix + "/operation") { operationAPI.POST("list", operationController.List) + operationAPI.POST("getOperationInfo/:number", operationController.GetOperationInfo) operationAPI.POST("operation", operationController.Add) operationAPI.POST("update", operationController.Update) operationAPI.DELETE("operation/:id", operationController.Delete) -- Gitblit v1.8.0