From 2c53a4e2c7ededc1f07324d797430e8d4a0607a1 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期二, 15 八月 2023 20:33:41 +0800 Subject: [PATCH] merge --- api/v1/client.go | 31 +++++++++++++++++++++++++++---- 1 files changed, 27 insertions(+), 4 deletions(-) diff --git a/api/v1/client.go b/api/v1/client.go index 278374b..c4da6b7 100644 --- a/api/v1/client.go +++ b/api/v1/client.go @@ -32,9 +32,7 @@ return } - // check member exist - - errCode = clientService.AddClient(client) + errCode = clientService.AddClient(client, params.SalesLeadsId) if errCode != ecode.OK { ctx.Fail(errCode) return @@ -59,7 +57,6 @@ //if params.MemberId == 0 { // return ecode.InvalidParams, nil //} - client.MemberId = params.MemberId t, err := checkTimeFormat(params.NextVisitTime) if err != nil { @@ -86,6 +83,7 @@ client.ClientOriginId = params.ClientOriginId client.ClientLevelId = params.ClientLevelId client.DetailAddress = params.DetailAddress + client.ClientStatusId = params.ClientStatusId client.Remark = params.Remark client.Number = params.Number client.ServiceMemberId = params.ServiceMemberId @@ -99,6 +97,7 @@ client.Business.IndustryId = params.IndustryId client.Business.EnterpriseNatureId = params.EnterpriseNatureId client.Business.EnterpriseScaleId = params.EnterpriseScaleId + client.MemberId = params.MemberId if params.Contact.Name != "" { // assign the client's member id to contact when adding @@ -202,3 +201,27 @@ Count: int(total), }) } + +// CheckName +// +// @Tags Client +// @Summary 妫�鏌ュ鎴峰悕绉版槸鍚﹂噸澶� +// @Produce application/json +// @Param object body request.CheckClientName true "鍙傛暟" +// @Success 200 {object} contextx.Response{} +// @Router /api/client/checkName [post] +func (cli *ClientApi) CheckName(c *gin.Context) { + var params request.CheckClientName + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + errCode := clientService.CheckName(params.Name) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.Ok() +} -- Gitblit v1.8.0