feat: 🤪 模板更新,文档更新

main
tian 2 years ago
parent 5fae73c7c9
commit 143b722316

@ -109,7 +109,7 @@ func (goodsShowApi *GoodsShowApi) UpdateGoodsShow(c *gin.Context) {
// @accept application/json // @accept application/json
// @Produce application/json // @Produce application/json
// @Param data query goods.GoodsShow true "用id查询商品" // @Param data query goods.GoodsShow true "用id查询商品"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" // @Success 200 {object} goods.GoodsShow{}"
// @Router /goodsShow/findGoodsShow [get] // @Router /goodsShow/findGoodsShow [get]
func (goodsShowApi *GoodsShowApi) FindGoodsShow(c *gin.Context) { func (goodsShowApi *GoodsShowApi) FindGoodsShow(c *gin.Context) {
ID := c.Query("ID") ID := c.Query("ID")
@ -128,7 +128,7 @@ func (goodsShowApi *GoodsShowApi) FindGoodsShow(c *gin.Context) {
// @accept application/json // @accept application/json
// @Produce application/json // @Produce application/json
// @Param data query goodsReq.GoodsShowSearch true "分页获取商品列表" // @Param data query goodsReq.GoodsShowSearch true "分页获取商品列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" // @Success 200 {object} goods.GoodsShowList{}"
// @Router /goodsShow/getGoodsShowList [get] // @Router /goodsShow/getGoodsShowList [get]
func (goodsShowApi *GoodsShowApi) GetGoodsShowList(c *gin.Context) { func (goodsShowApi *GoodsShowApi) GetGoodsShowList(c *gin.Context) {
var pageInfo goodsReq.GoodsShowSearch var pageInfo goodsReq.GoodsShowSearch

@ -2627,9 +2627,9 @@ const docTemplate = `{
], ],
"responses": { "responses": {
"200": { "200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", "description": "OK",
"schema": { "schema": {
"type": "string" "$ref": "#/definitions/goods.GoodsShow"
} }
} }
} }
@ -2699,9 +2699,12 @@ const docTemplate = `{
], ],
"responses": { "responses": {
"200": { "200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", "description": "OK",
"schema": { "schema": {
"type": "string" "type": "array",
"items": {
"$ref": "#/definitions/goods.GoodsShow"
}
} }
} }
} }

@ -2619,9 +2619,9 @@
], ],
"responses": { "responses": {
"200": { "200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", "description": "OK",
"schema": { "schema": {
"type": "string" "$ref": "#/definitions/goods.GoodsShow"
} }
} }
} }
@ -2691,9 +2691,12 @@
], ],
"responses": { "responses": {
"200": { "200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", "description": "OK",
"schema": { "schema": {
"type": "string" "type": "array",
"items": {
"$ref": "#/definitions/goods.GoodsShow"
}
} }
} }
} }

@ -3150,9 +3150,9 @@ paths:
- application/json - application/json
responses: responses:
"200": "200":
description: '{"success":true,"data":{},"msg":"查询成功"}' description: OK
schema: schema:
type: string $ref: '#/definitions/goods.GoodsShow'
security: security:
- ApiKeyAuth: [] - ApiKeyAuth: []
summary: 用id查询商品 summary: 用id查询商品
@ -3194,9 +3194,11 @@ paths:
- application/json - application/json
responses: responses:
"200": "200":
description: '{"success":true,"data":{},"msg":"获取成功"}' description: OK
schema: schema:
type: string items:
$ref: '#/definitions/goods.GoodsShow'
type: array
security: security:
- ApiKeyAuth: [] - ApiKeyAuth: []
summary: 分页获取商品列表 summary: 分页获取商品列表

@ -23,3 +23,5 @@ type GoodsShow struct {
func (GoodsShow) TableName() string { func (GoodsShow) TableName() string {
return "goods_show" return "goods_show"
} }
type GoodsShowList []GoodsShow

@ -125,7 +125,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Update{{.StructName}}(c *gin.Con
// @accept application/json // @accept application/json
// @Produce application/json // @Produce application/json
// @Param data query {{.Package}}.{{.StructName}} true "用id查询{{.Description}}" // @Param data query {{.Package}}.{{.StructName}} true "用id查询{{.Description}}"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" // @Success 200 {object} {{.Package}}.{{.StructName}}{}"
// @Router /{{.Abbreviation}}/find{{.StructName}} [get] // @Router /{{.Abbreviation}}/find{{.StructName}} [get]
func ({{.Abbreviation}}Api *{{.StructName}}Api) Find{{.StructName}}(c *gin.Context) { func ({{.Abbreviation}}Api *{{.StructName}}Api) Find{{.StructName}}(c *gin.Context) {
{{.PrimaryField.FieldJson}} := c.Query("{{.PrimaryField.FieldJson}}") {{.PrimaryField.FieldJson}} := c.Query("{{.PrimaryField.FieldJson}}")
@ -144,7 +144,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Find{{.StructName}}(c *gin.Conte
// @accept application/json // @accept application/json
// @Produce application/json // @Produce application/json
// @Param data query {{.Package}}Req.{{.StructName}}Search true "分页获取{{.Description}}列表" // @Param data query {{.Package}}Req.{{.StructName}}Search true "分页获取{{.Description}}列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" // @Success 200 {object} {{.Package}}.{{.StructName}}List{}"
// @Router /{{.Abbreviation}}/get{{.StructName}}List [get] // @Router /{{.Abbreviation}}/get{{.StructName}}List [get]
func ({{.Abbreviation}}Api *{{.StructName}}Api) Get{{.StructName}}List(c *gin.Context) { func ({{.Abbreviation}}Api *{{.StructName}}Api) Get{{.StructName}}List(c *gin.Context) {
var pageInfo {{.Package}}Req.{{.StructName}}Search var pageInfo {{.Package}}Req.{{.StructName}}Search

@ -41,3 +41,5 @@ func ({{.StructName}}) TableName() string {
return "{{.TableName}}" return "{{.TableName}}"
} }
{{ end }} {{ end }}
type {{.StructName}}List []{{.StructName}}
Loading…
Cancel
Save