From 4d6f4f45ee1c5c44bb0aba94430364f3becb94d1 Mon Sep 17 00:00:00 2001 From: wzj Date: Mon, 11 Nov 2024 22:06:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8C=89=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=9A=84=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/item_controller.go | 6 +++--- docs/docs.go | 2 +- docs/swagger.json | 2 +- docs/swagger.yaml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/controller/item_controller.go b/controller/item_controller.go index 7958724..8d2bfd1 100644 --- a/controller/item_controller.go +++ b/controller/item_controller.go @@ -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() diff --git a/docs/docs.go b/docs/docs.go index 11fd975..74fde31 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -304,7 +304,7 @@ const docTemplate = `{ } } }, - "/api/item/list/{type}": { + "/api/item/list/type/{type}": { "get": { "description": "通过类型获取相关商品列表", "consumes": [ diff --git a/docs/swagger.json b/docs/swagger.json index 7acc4ea..c05bc4d 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -298,7 +298,7 @@ } } }, - "/api/item/list/{type}": { + "/api/item/list/type/{type}": { "get": { "description": "通过类型获取相关商品列表", "consumes": [ diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 1553c97..63d2846 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -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