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

Method SignToday

controllers/api/LoginedController.go:224–235  ·  view source on GitHub ↗

执行签到

()

Source from the content-addressed store, hash-verified

222
223// 执行签到
224func (this *LoginedController) SignToday() {
225 s := models.NewSign()
226 reward, err := s.Sign(this.isLogin(), true)
227 if err != nil {
228 this.Response(http.StatusBadRequest, "签到失败:"+err.Error())
229 }
230 data := map[string]interface{}{
231 "message": fmt.Sprintf("恭喜您,签到成功,阅读时长增加 %v 秒", reward),
232 "signed_at": s.LatestSignTime(this.isLogin()),
233 }
234 this.Response(http.StatusOK, messageSuccess, data)
235}
236
237// 查询签到状态
238func (this *LoginedController) SignStatus() {

Callers

nothing calls this directly

Calls 5

NewSignFunction · 0.92
SignMethod · 0.80
isLoginMethod · 0.80
ResponseMethod · 0.80
LatestSignTimeMethod · 0.80

Tested by

no test coverage detected