mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-27 23:41:22 +08:00
优化服务监控定时器,移除notify
功能包
This commit is contained in:
@@ -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 == "" {
|
||||
|
Reference in New Issue
Block a user