添加或者移除书签
()
| 21 | |
| 22 | //添加或者移除书签 |
| 23 | func (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 | //获取书签列表 |
| 45 | func (this *BookmarkController) List() { |
nothing calls this directly
no test coverage detected