From d9ec14b9adf6e90309d763e3b3b1b0f22773f8da Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期二, 18 七月 2023 15:07:47 +0800 Subject: [PATCH] fix --- api/v1/region.go | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/api/v1/region.go b/api/v1/region.go index 2e123c2..df63a21 100644 --- a/api/v1/region.go +++ b/api/v1/region.go @@ -13,6 +13,7 @@ type RegionApi struct{} // Add +// // @Tags Region // @Summary 娣诲姞鍦板尯 // @Produce application/json @@ -39,6 +40,7 @@ } // Set +// // @Tags Region // @Summary 璁剧疆鍦板尯 // @Produce application/json @@ -62,6 +64,7 @@ } // Delete +// // @Tags Region // @Summary 鍒犻櫎鍦板尯 // @Produce application/json @@ -86,6 +89,7 @@ } // Update +// // @Tags Region // @Summary 鏇存柊鍦板尯 // @Produce application/json @@ -109,10 +113,12 @@ } // List +// // @Tags Region // @Summary 鍦板尯鍒楄〃 // @Produce application/json -// @Success 200 {object} contextx.Response{} +// @Param city_id query int true "鍩庡競ID" +// @Success 200 {object} contextx.Response{} // @Router /api/region/list [get] func (r *RegionApi) List(c *gin.Context) { ctx, ok := contextx.NewContext(c, nil) @@ -120,7 +126,8 @@ return } - regionList, errCode := regionService.ListRegions() + cityId, _ := strconv.Atoi(c.Query("city_id")) + regionList, errCode := regionService.ListRegions(cityId) if errCode != ecode.OK { ctx.Fail(errCode) return -- Gitblit v1.8.0