From 2071758a2b24cc21521ec1888df7ddf60065e88f Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期六, 28 十月 2023 15:33:09 +0800 Subject: [PATCH] 新增用户信息更新管理器,定时更新活跃用户的详情,当用户访问系统的时候更新活跃时间,定时清理非活跃用户 --- api/v1/serviceFollowup.go | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/api/v1/serviceFollowup.go b/api/v1/serviceFollowup.go index 39af767..d457ead 100644 --- a/api/v1/serviceFollowup.go +++ b/api/v1/serviceFollowup.go @@ -40,17 +40,20 @@ return } + count, err := model.NewServiceFollowupSearch().SetNumber(serviceFollowup.Number).Count() + if err != nil { + ctx.FailWithMsg(ecode.UnknownErr, "缂栫爜楠岃瘉澶辫触") + return + } + if count > 0 { + ctx.FailWithMsg(ecode.UnknownErr, "缂栫爜宸插瓨鍦�") + return + } + errCode = serviceFollowupService.AddServiceFollowup(&serviceFollowup) if errCode != ecode.OK { ctx.Fail(errCode) return - } - if params.CodeRule.Method == 1 { - autoCode := model.GetAutoCode(serviceFollowup.Id, ¶ms.CodeRule) - m := map[string]interface{}{ - "number": autoCode, - } - _ = model.NewServiceFollowupSearch().SetId(serviceFollowup.Id).UpdateByMap(m) } ctx.Ok() -- Gitblit v1.8.0