From 7f8a45a749419c3da5b81c4683f0b8034f5280f3 Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期二, 25 七月 2023 15:20:09 +0800
Subject: [PATCH] fix
---
api/v1/province.go | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/api/v1/province.go b/api/v1/province.go
index 93d6692..0c71dc9 100644
--- a/api/v1/province.go
+++ b/api/v1/province.go
@@ -13,6 +13,7 @@
type ProvinceApi struct{}
// Add
+//
// @Tags Province
// @Summary 娣诲姞鐪佷唤
// @Produce application/json
@@ -39,6 +40,7 @@
}
// Update
+//
// @Tags Province
// @Summary 鏇存柊鐪佷唤
// @Produce application/json
@@ -62,10 +64,12 @@
}
// List
+//
// @Tags Province
// @Summary 鑾峰彇鐪佷唤鍒楄〃
// @Produce application/json
-// @Success 200 {object} contextx.Response{data=response.ProvinceResponse}
+// @Param country_id query int true "鍥藉ID"
+// @Success 200 {object} contextx.Response{data=response.ProvinceResponse}
// @Router /api/province/list [get]
func (p *ProvinceApi) List(c *gin.Context) {
ctx, ok := contextx.NewContext(c, nil)
@@ -73,7 +77,8 @@
return
}
- provinces, errCode := provinceService.GetProvinces()
+ countryId, _ := strconv.Atoi(c.Query("country_id"))
+ provinces, errCode := provinceService.GetProvinces(countryId)
if errCode != ecode.OK {
ctx.Fail(errCode)
return
@@ -85,6 +90,7 @@
}
// Set
+//
// @Tags Province
// @Summary 璁剧疆鐪佷唤
// @Produce application/json
@@ -108,6 +114,7 @@
}
// Delete
+//
// @Tags Province
// @Summary 鍒犻櫎鐪佷唤
// @Produce application/json
--
Gitblit v1.8.0