修改按类型获取的接口地址
Some checks failed
Deploy on Tag / build-and-deploy (push) Failing after 10s

This commit is contained in:
wzj 2024-11-11 22:06:24 +08:00
parent 481ebd18db
commit 4d6f4f45ee
4 changed files with 6 additions and 6 deletions

View File

@ -14,7 +14,7 @@ type ItemController struct {
func (c *ItemController) BeforeActivation(b mvc.BeforeActivation) {
b.Handle("GET", "/detail/{id:uint}", "Detail")
b.Handle("GET", "/list/{ttype:int}", "GetList")
b.Handle("GET", "/list/type/{ttype:int}", "GetListByType")
b.Handle("GET", "/search", "Search")
b.Handle("GET", "types", "GetTypes")
@ -56,8 +56,8 @@ func (c *ItemController) Detail(id uint) mvc.Result {
// @Param type path string true "商品类型"
// @Success 200 {object} []model.ItemModel "{["id":1],["id":2]}"
// @Failure 400 {object} map[string]interface{} "{"msg": "错误信息","code":0}"
// @Router /api/item/list/{type} [get]
func (c *ItemController) GetList(ttype int) mvc.Result {
// @Router /api/item/list/type/{type} [get]
func (c *ItemController) GetListByType(ttype int) mvc.Result {
items, e := c.Service.Item.GetItems(ttype)
if e.Error() {
return e.Response()

View File

@ -304,7 +304,7 @@ const docTemplate = `{
}
}
},
"/api/item/list/{type}": {
"/api/item/list/type/{type}": {
"get": {
"description": "通过类型获取相关商品列表",
"consumes": [

View File

@ -298,7 +298,7 @@
}
}
},
"/api/item/list/{type}": {
"/api/item/list/type/{type}": {
"get": {
"description": "通过类型获取相关商品列表",
"consumes": [

View File

@ -352,7 +352,7 @@ paths:
summary: get item api
tags:
- item api
/api/item/list/{type}:
/api/item/list/type/{type}:
get:
consumes:
- application/json