(ctx context.Context, actionType string, unit string)
| 107 | } |
| 108 | |
| 109 | func (cs *CaptchaService) ActionRecordAdd(ctx context.Context, actionType string, unit string) { |
| 110 | info, err := cs.captchaRepo.GetActionType(ctx, unit, actionType) |
| 111 | if err != nil { |
| 112 | log.Error(err) |
| 113 | return |
| 114 | } |
| 115 | amount := 1 |
| 116 | if info != nil { |
| 117 | amount = info.Num + 1 |
| 118 | } |
| 119 | err = cs.captchaRepo.SetActionType(ctx, unit, actionType, "", amount) |
| 120 | if err != nil { |
| 121 | log.Error(err) |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | func (cs *CaptchaService) ActionRecordDel(ctx context.Context, actionType string, unit string) { |
| 126 | err := cs.captchaRepo.DelActionType(ctx, unit, actionType) |
no test coverage detected