给书籍打分
()
| 1320 | |
| 1321 | // 给书籍打分 |
| 1322 | func (this *BookController) Score() { |
| 1323 | bookId, _ := this.GetInt(":id") |
| 1324 | if bookId == 0 { |
| 1325 | this.JsonResult(1, "文档不存在") |
| 1326 | } |
| 1327 | |
| 1328 | score, _ := this.GetInt("score") |
| 1329 | if uid := this.Member.MemberId; uid > 0 { |
| 1330 | if err := new(models.Score).AddScore(uid, bookId, score); err != nil { |
| 1331 | this.JsonResult(1, err.Error()) |
| 1332 | } |
| 1333 | this.JsonResult(0, "感谢您给当前文档打分") |
| 1334 | } |
| 1335 | this.JsonResult(1, "给文档打分失败,请先登录再操作") |
| 1336 | } |
| 1337 | |
| 1338 | // 添加评论 |
| 1339 | func (this *BookController) Comment() { |
nothing calls this directly
no test coverage detected