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

Method HistoryReadBook

controllers/api/CommonController.go:1171–1188  ·  view source on GitHub ↗

查询最近阅读过的书籍,返回最近50本

()

Source from the content-addressed store, hash-verified

1169
1170// 查询最近阅读过的书籍,返回最近50本
1171func (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
1190func (this *CommonController) LatestVersion() {
1191 version, _ := strconv.Atoi(models.GetOptionValue("APP_VERSION", "0"))

Callers

nothing calls this directly

Calls 4

NewReadRecordFunction · 0.92
isLoginMethod · 0.80
completeLinkMethod · 0.80
ResponseMethod · 0.80

Tested by

no test coverage detected