执行签到
()
| 222 | |
| 223 | // 执行签到 |
| 224 | func (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 | // 查询签到状态 |
| 238 | func (this *LoginedController) SignStatus() { |
nothing calls this directly
no test coverage detected