关注或取消关注
()
| 554 | |
| 555 | // 关注或取消关注 |
| 556 | func (this *BaseController) SetFollow() { |
| 557 | var cancel bool |
| 558 | if this.Member == nil || this.Member.MemberId == 0 { |
| 559 | this.JsonResult(1, "请先登录") |
| 560 | } |
| 561 | uid, _ := this.GetInt(":uid") |
| 562 | if uid == this.Member.MemberId { |
| 563 | this.JsonResult(1, "自己不能关注自己") |
| 564 | } |
| 565 | cancel, _ = new(models.Fans).FollowOrCancel(uid, this.Member.MemberId) |
| 566 | if cancel { |
| 567 | this.JsonResult(0, "您已经成功取消了关注") |
| 568 | } |
| 569 | this.JsonResult(0, "您已经成功关注了Ta") |
| 570 | } |
| 571 | |
| 572 | func (this *BaseController) SignToday() { |
| 573 | if this.Member == nil || this.Member.MemberId == 0 { |
nothing calls this directly
no test coverage detected