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

Method Score

controllers/BookController.go:1322–1336  ·  view source on GitHub ↗

给书籍打分

()

Source from the content-addressed store, hash-verified

1320
1321// 给书籍打分
1322func (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// 添加评论
1339func (this *BookController) Comment() {

Callers

nothing calls this directly

Calls 2

JsonResultMethod · 0.80
AddScoreMethod · 0.80

Tested by

no test coverage detected