优化服务监控定时器,移除notify功能包

This commit is contained in:
孟帅
2023-08-07 17:58:24 +08:00
parent 3df5236623
commit 90d09deeff
88 changed files with 415 additions and 723 deletions

View File

@@ -245,7 +245,7 @@ func (s *sSysSmsLog) AllowSend(ctx context.Context, models *entity.SysSmsLog, co
}
if config.SmsMaxIpLimit > 0 {
count, err := dao.SysSmsLog.NowDayCount(ctx, models.Event, models.Mobile)
count, err := s.NowDayCount(ctx, models.Event, models.Mobile)
if err != nil {
return err
}
@@ -258,6 +258,15 @@ func (s *sSysSmsLog) AllowSend(ctx context.Context, models *entity.SysSmsLog, co
return
}
// NowDayCount 当天发送次数
func (s *sSysSmsLog) NowDayCount(ctx context.Context, event, mobile string) (count int, err error) {
return dao.SysSmsLog.Ctx(ctx).
Where("mobile", mobile).
Where("event", event).
WhereGTE("created_at", gtime.Now().Format("Y-m-d")).
Count()
}
// VerifyCode 效验验证码
func (s *sSysSmsLog) VerifyCode(ctx context.Context, in *sysin.VerifyCodeInp) (err error) {
if in.Event == "" {