From 8bf1cad94113d5c604e95e370cf068efdea87d27 Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期三, 30 八月 2023 09:43:49 +0800
Subject: [PATCH] fix
---
api/v1/serviceType.go | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/api/v1/serviceType.go b/api/v1/serviceType.go
index ed5843b..5888c23 100644
--- a/api/v1/serviceType.go
+++ b/api/v1/serviceType.go
@@ -13,8 +13,8 @@
type ServiceTypeApi struct{}
// Add
-// @Tags 鏈嶅姟绫诲瀷绠$悊
-// @Summary 娣诲姞鏈嶅姟绫诲瀷
+// @Tags 鏈嶅姟鏂瑰紡绠$悊
+// @Summary 娣诲姞鏈嶅姟鏂瑰紡
// @Produce application/json
// @Param object body request.AddServiceType true "鏌ヨ鍙傛暟"
// @Success 200 {object} contextx.Response{}
@@ -36,8 +36,8 @@
}
// Delete
-// @Tags 鏈嶅姟绫诲瀷绠$悊
-// @Summary 鍒犻櫎鏈嶅姟绫诲瀷
+// @Tags 鏈嶅姟鏂瑰紡绠$悊
+// @Summary 鍒犻櫎鏈嶅姟鏂瑰紡
// @Produce application/json
// @Param id path int true "鏌ヨ鍙傛暟"
// @Success 200 {object} contextx.Response{}
@@ -59,8 +59,8 @@
}
// Update
-// @Tags 鏈嶅姟绫诲瀷绠$悊
-// @Summary 鏇存柊鏈嶅姟绫诲瀷
+// @Tags 鏈嶅姟鏂瑰紡绠$悊
+// @Summary 鏇存柊鏈嶅姟鏂瑰紡
// @Produce application/json
// @Param object body request.UpdateServiceType true "鏌ヨ鍙傛暟"
// @Success 200 {object} contextx.Response{}
@@ -71,6 +71,10 @@
if !ok {
return
}
+ if params.Id == 0 {
+ ctx.Fail(ecode.ParamsErr)
+ }
+ params.ServiceType.Id = params.Id
errCode := service.NewServiceTypeService().UpdateServiceType(¶ms.ServiceType)
if errCode != ecode.OK {
@@ -82,8 +86,8 @@
}
// List
-// @Tags 鏈嶅姟绫诲瀷绠$悊
-// @Summary 鑾峰彇鏈嶅姟绫诲瀷鍒楄〃
+// @Tags 鏈嶅姟鏂瑰紡绠$悊
+// @Summary 鑾峰彇鏈嶅姟鏂瑰紡鍒楄〃
// @Produce application/json
// @Success 200 {object} response.ListResponse{data=[]model.ServiceType}
// @Router /api/serviceType/list [get]
--
Gitblit v1.8.0