查询最近阅读过的书籍,返回最近50本
()
| 1169 | |
| 1170 | // 查询最近阅读过的书籍,返回最近50本 |
| 1171 | func (this *CommonController) HistoryReadBook() { |
| 1172 | page, _ := this.GetInt("page", 1) |
| 1173 | size, _ := this.GetInt("size", 10) |
| 1174 | if size <= 0 { |
| 1175 | size = 10 |
| 1176 | } |
| 1177 | data := map[string]interface{}{"books": []string{}} |
| 1178 | uid := this.isLogin() |
| 1179 | if uid > 0 { |
| 1180 | books := models.NewReadRecord().HistoryReadBook(uid, page, size) |
| 1181 | for idx, book := range books { |
| 1182 | book.Cover = this.completeLink(book.Cover) |
| 1183 | books[idx] = book |
| 1184 | } |
| 1185 | data["books"] = books |
| 1186 | } |
| 1187 | this.Response(http.StatusOK, messageSuccess, data) |
| 1188 | } |
| 1189 | |
| 1190 | func (this *CommonController) LatestVersion() { |
| 1191 | version, _ := strconv.Atoi(models.GetOptionValue("APP_VERSION", "0")) |
nothing calls this directly
no test coverage detected