()
| 1148 | } |
| 1149 | |
| 1150 | func (this *CommonController) RelatedBook() { |
| 1151 | bookId := this.getBookIdByIdentify(this.GetString("identify")) |
| 1152 | if bookId <= 0 { |
| 1153 | this.Response(http.StatusBadRequest, messageBadRequest) |
| 1154 | } |
| 1155 | res := models.NewRelateBook().Lists(bookId) |
| 1156 | var books []APIBook |
| 1157 | for _, item := range res { |
| 1158 | book := APIBook{} |
| 1159 | utils.CopyObject(&item, &book) |
| 1160 | book.Cover = this.completeLink(utils.ShowImg(book.Cover, "cover")) |
| 1161 | books = append(books, book) |
| 1162 | } |
| 1163 | data := map[string]interface{}{"books": []string{}} |
| 1164 | if len(books) > 0 { |
| 1165 | data["books"] = books |
| 1166 | } |
| 1167 | this.Response(http.StatusOK, messageSuccess, data) |
| 1168 | } |
| 1169 | |
| 1170 | // 查询最近阅读过的书籍,返回最近50本 |
| 1171 | func (this *CommonController) HistoryReadBook() { |
nothing calls this directly
no test coverage detected