From f04def67f695e69591ccdd73bb339c6f402b477c Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期六, 05 八月 2023 13:36:57 +0800 Subject: [PATCH] update --- 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