From 6aa75c2a266a2522ae713b13dc702b5ad0a08f87 Mon Sep 17 00:00:00 2001 From: liujiandao <274878379@qq.com> Date: 星期二, 24 十月 2023 13:50:23 +0800 Subject: [PATCH] 编码规则需求功能开发 --- api/v1/followRecord.go | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/api/v1/followRecord.go b/api/v1/followRecord.go index d64b85a..1fe90dd 100644 --- a/api/v1/followRecord.go +++ b/api/v1/followRecord.go @@ -36,6 +36,16 @@ return } + count, err := model.NewFollowRecordSearch().SetNumber(followRecord.Number).Count() + if err != nil { + ctx.FailWithMsg(ecode.UnknownErr, "缂栫爜楠岃瘉澶辫触") + return + } + if count > 0 { + ctx.FailWithMsg(ecode.UnknownErr, "缂栫爜宸插瓨鍦�") + return + } + if followRecord.MemberId == 0 { userInfo := utils.GetUserInfo(c) if userInfo.UserType == constvar.UserTypeSub { @@ -47,13 +57,6 @@ if errCode != ecode.OK { ctx.Fail(errCode) return - } - if params.FollowRecord.CodeRule.Method == 1 { - autoCode := model.GetAutoCode(followRecord.Id, ¶ms.FollowRecord.CodeRule) - m := map[string]interface{}{ - "number": autoCode, - } - _ = model.NewFollowRecordSearch().SetId(followRecord.Id).UpdateMap(m) } ctx.Ok() -- Gitblit v1.8.0