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

Method Bookmark

controllers/BookmarkController.go:23–42  ·  view source on GitHub ↗

添加或者移除书签

()

Source from the content-addressed store, hash-verified

21
22//添加或者移除书签
23func (this *BookmarkController) Bookmark() {
24 docId, _ := this.GetInt(":id")
25 if docId <= 0 {
26 this.JsonResult(1, "收藏失败,文档id参数错误")
27 }
28
29 insert, err := new(models.Bookmark).InsertOrDelete(this.Member.MemberId, docId)
30 if err != nil {
31 beego.Error(err.Error())
32 if insert {
33 this.JsonResult(1, "添加书签失败", insert)
34 }
35 this.JsonResult(1, "移除书签失败", insert)
36 }
37
38 if insert {
39 this.JsonResult(0, "添加书签成功", insert)
40 }
41 this.JsonResult(0, "移除书签成功", insert)
42}
43
44//获取书签列表
45func (this *BookmarkController) List() {

Callers

nothing calls this directly

Calls 2

JsonResultMethod · 0.80
InsertOrDeleteMethod · 0.80

Tested by

no test coverage detected