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

main
tian 2 years ago
parent 5fae73c7c9
commit 143b722316

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

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

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

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

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

@ -125,7 +125,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Update{{.StructName}}(c *gin.Con
// @accept application/json
// @Produce application/json
// @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]
func ({{.Abbreviation}}Api *{{.StructName}}Api) Find{{.StructName}}(c *gin.Context) {
{{.PrimaryField.FieldJson}} := c.Query("{{.PrimaryField.FieldJson}}")
@ -144,7 +144,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Find{{.StructName}}(c *gin.Conte
// @accept application/json
// @Produce application/json
// @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]
func ({{.Abbreviation}}Api *{{.StructName}}Api) Get{{.StructName}}List(c *gin.Context) {
var pageInfo {{.Package}}Req.{{.StructName}}Search

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