MCPcopy Index your code
hub / github.com/TruthHun/BookStack / UpdateReadingRule

Method UpdateReadingRule

models/read_record.go:323–338  ·  view source on GitHub ↗

更新签到奖励规则

()

Source from the content-addressed store, hash-verified

321
322// 更新签到奖励规则
323func (*ReadRecord) UpdateReadingRule() {
324 ops := []string{"READING_MIN_INTERVAL", "READING_MAX_INTERVAL", "READING_INTERVAL_MAX_REWARD", "READING_INVALID_INTERVAL"}
325 for _, op := range ops {
326 num, _ := strconv.Atoi(GetOptionValue(op, ""))
327 switch op {
328 case "READING_MIN_INTERVAL":
329 _readingRule.Min = num
330 case "READING_MAX_INTERVAL":
331 _readingRule.Max = num
332 case "READING_INTERVAL_MAX_REWARD":
333 _readingRule.MaxReward = num
334 case "READING_INVALID_INTERVAL":
335 _readingRule.Invalid = num
336 }
337 }
338}
339
340// 获取阅读计时规则
341func (*ReadRecord) GetReadingRule() (r *ReadingRule) {

Callers 2

SettingMethod · 0.80
InitFunction · 0.80

Calls 1

GetOptionValueFunction · 0.85

Tested by

no test coverage detected