MCPcopy Index your code
hub / github.com/apache/answer / ActionRecordAdd

Method ActionRecordAdd

internal/service/action/captcha_service.go:109–123  ·  view source on GitHub ↗
(ctx context.Context, actionType string, unit string)

Source from the content-addressed store, hash-verified

107}
108
109func (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
125func (cs *CaptchaService) ActionRecordDel(ctx context.Context, actionType string, unit string) {
126 err := cs.captchaRepo.DelActionType(ctx, unit, actionType)

Callers 15

AddCommentMethod · 0.80
RemoveCommentMethod · 0.80
UpdateCommentMethod · 0.80
SearchMethod · 0.80
VoteUpMethod · 0.80
VoteDownMethod · 0.80
RemoveQuestionMethod · 0.80
AddQuestionMethod · 0.80
AddQuestionByAnswerMethod · 0.80
UpdateQuestionMethod · 0.80
AddReportMethod · 0.80

Calls 2

GetActionTypeMethod · 0.65
SetActionTypeMethod · 0.65

Tested by

no test coverage detected