From 1109d0c6565e3413e54d9f28e68dda8ca26b99c4 Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期二, 25 七月 2023 11:19:52 +0800
Subject: [PATCH] fix

---
 api/v1/client.go |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/api/v1/client.go b/api/v1/client.go
index 2e3d7ee..96aa141 100644
--- a/api/v1/client.go
+++ b/api/v1/client.go
@@ -68,20 +68,20 @@
 
 func checkClientParams(params request.Client) (int, *model.Client) {
 	client := new(model.Client)
-	if params.Name == "" {
-		return ecode.InvalidParams, nil
-	}
+	//if params.Name == "" {
+	//	return ecode.InvalidParams, nil
+	//}
 
 	client.Name = params.Name
 
-	if params.ClientStatusId == 0 {
-		return ecode.InvalidParams, nil
-	}
-	client.ClientStatusId = params.ClientStatusId
-
-	if params.MemberId == 0 {
-		return ecode.InvalidParams, nil
-	}
+	//if params.ClientStatusId == 0 {
+	//	return ecode.InvalidParams, nil
+	//}
+	//client.ClientStatusId = params.ClientStatusId
+	//
+	//if params.MemberId == 0 {
+	//	return ecode.InvalidParams, nil
+	//}
 	client.MemberId = params.MemberId
 
 	t, err := checkTimeFormat(params.NextVisitTime)
@@ -168,7 +168,7 @@
 //	@Produce	application/json
 //	@Param		object	body		request.UpdateClient	true	"鏌ヨ鍙傛暟"
 //	@Success	200		{object}	contextx.Response{}
-//	@Router		/api/client/update [post]
+//	@Router		/api/client/update [put]
 func (cli *ClientApi) Update(c *gin.Context) {
 	var params request.UpdateClient
 	ctx, ok := contextx.NewContext(c, &params)
@@ -188,6 +188,8 @@
 		return
 	}
 
+	client.Id = params.Id
+
 	errCode = clientService.UpdateClient(client)
 	if errCode != ecode.OK {
 		ctx.Fail(errCode)

--
Gitblit v1.8.0