优化服务监控定时器,移除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

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