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

Method GetUserMoreInfo

controllers/api/CommonController.go:201–224  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

199}
200
201func (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】
227func (this *CommonController) Register() {

Callers

nothing calls this directly

Calls 7

GetReadingTimeMethod · 0.95
NewMemberFunction · 0.92
NewReadingTimeFunction · 0.92
NewSignFunction · 0.92
ResponseMethod · 0.80
LatestSignTimeMethod · 0.80
FindMethod · 0.45

Tested by

no test coverage detected