From 530fed8ec225453572d57b15c200ab062c335457 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期三, 01 十一月 2023 19:20:21 +0800 Subject: [PATCH] 公海member_id使用0 --- api/v1/city.go | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/api/v1/city.go b/api/v1/city.go index 3c37915..c7ef526 100644 --- a/api/v1/city.go +++ b/api/v1/city.go @@ -13,6 +13,7 @@ type CityApi struct{} // Add +// // @Tags City // @Summary 娣诲姞鍩庡競 // @Produce application/json @@ -44,6 +45,7 @@ } // Set +// // @Tags City // @Summary 璁剧疆鍩庡競 // @Produce application/json @@ -67,10 +69,12 @@ } // List +// // @Tags City // @Summary 鑾峰彇鍩庡競鍒楄〃 // @Produce application/json -// @Success 200 {object} contextx.Response{data=response.CityResponse} "鎴愬姛" +// @Param province_id query int false "鐪佷唤ID" +// @Success 200 {object} contextx.Response{data=response.CityResponse} "鎴愬姛" // @Router /api/city/list [get] func (ci *CityApi) List(c *gin.Context) { ctx, ok := contextx.NewContext(c, nil) @@ -78,7 +82,9 @@ return } - cities, errCode := cityService.ListCities() + // 鑾峰彇鐪佷唤ID + provinceId, _ := strconv.Atoi(c.Query("province_id")) + cities, errCode := cityService.ListCities(provinceId) if errCode != ecode.OK { ctx.Fail(errCode) return @@ -90,6 +96,7 @@ } // Delete +// // @Tags City // @Summary 鍒犻櫎鍩庡競 // @Produce application/json @@ -113,6 +120,7 @@ } // Update +// // @Tags City // @Summary 鏇存柊鍩庡競 // @Produce application/json -- Gitblit v1.8.0