()
| 199 | } |
| 200 | |
| 201 | func (this *CommonController) GetUserMoreInfo() { |
| 202 | uid, _ := this.GetInt("uid") |
| 203 | if uid <= 0 { |
| 204 | this.Response(http.StatusBadRequest, messageBadRequest) |
| 205 | } |
| 206 | cols := []string{"create_time", "total_reading_time", "total_sign", "total_continuous_sign", "history_total_continuous_sign"} |
| 207 | m, err := models.NewMember().Find(uid, cols...) |
| 208 | if err != nil { |
| 209 | this.Response(http.StatusInternalServerError, messageInternalServerError) |
| 210 | } |
| 211 | rt := models.NewReadingTime() |
| 212 | u := UserMoreInfo{ |
| 213 | MemberId: uid, |
| 214 | SignedAt: models.NewSign().LatestSignTime(uid), |
| 215 | CreatedAt: int(m.CreateTime.Unix()), |
| 216 | TotalSign: m.TotalSign, |
| 217 | TotalContinuousSign: m.TotalContinuousSign, |
| 218 | HistoryContinuousSign: m.HistoryTotalContinuousSign, |
| 219 | TodayReading: rt.GetReadingTime(uid, models.PeriodDay), |
| 220 | MonthReading: rt.GetReadingTime(uid, models.PeriodMonth), |
| 221 | TotalReading: m.TotalReadingTime, |
| 222 | } |
| 223 | this.Response(http.StatusOK, messageSuccess, map[string]interface{}{"info": u}) |
| 224 | } |
| 225 | |
| 226 | // 【OK】 |
| 227 | func (this *CommonController) Register() { |
nothing calls this directly
no test coverage detected