| | |
| | | productId := c.Query("productNumber") |
| | | cli := product.NewProductServiceClient(productServiceConn) |
| | | |
| | | getProductInfoResponse, err := cli.GetProductInfo(ctx.GetCtx(), &product.GetProductInfoRequest{ProductId: productId}, nil) |
| | | getProductInfoResponse, err := cli.GetProductInfo(ctx.GetCtx(), &product.GetProductInfoRequest{ProductId: productId}) |
| | | if err != nil { |
| | | logx.Errorf("GetProductInfo err: %v", err.Error()) |
| | | ctx.FailWithMsg(ecode.UnknownErr, "内部错误") |
| | |
| | | ctx.FailWithMsg(ecode.UnknownErr, "内部错误") |
| | | return |
| | | } |
| | | ctx.OkWithDetailed(contextx.Response{ |
| | | Data: getProductInfoResponse.Data, |
| | | }) |
| | | ctx.OkWithDetailed(getProductInfoResponse.Data) |
| | | } |
| | |
| | | "summary": "获取产品列表", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "name": "ProductName", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "ProductNumber", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "页码", |
| | | "name": "page", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "每页大小", |
| | | "name": "pageSize", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "description": "产品名称", |
| | | "name": "productName", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "description": "产品编码", |
| | | "name": "productNumber", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | |
| | | "summary": "获取产品列表", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "name": "ProductName", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "name": "ProductNumber", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "页码", |
| | | "name": "page", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "每页大小", |
| | | "name": "pageSize", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "description": "产品名称", |
| | | "name": "productName", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "description": "产品编码", |
| | | "name": "productNumber", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | |
| | | /api/product/list: |
| | | get: |
| | | parameters: |
| | | - in: query |
| | | name: ProductName |
| | | type: string |
| | | - in: query |
| | | name: ProductNumber |
| | | type: string |
| | | - in: query |
| | | - description: 页码 |
| | | in: query |
| | | name: page |
| | | type: integer |
| | | - in: query |
| | | - description: 每页大小 |
| | | in: query |
| | | name: pageSize |
| | | type: integer |
| | | - description: 产品名称 |
| | | in: query |
| | | name: productName |
| | | type: string |
| | | - description: 产品编码 |
| | | in: query |
| | | name: productNumber |
| | | type: string |
| | | produces: |
| | | - application/json |
| | | responses: |