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

Method SetFollow

controllers/BaseController.go:556–570  ·  view source on GitHub ↗

关注或取消关注

()

Source from the content-addressed store, hash-verified

554
555// 关注或取消关注
556func (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
572func (this *BaseController) SignToday() {
573 if this.Member == nil || this.Member.MemberId == 0 {

Callers

nothing calls this directly

Calls 2

JsonResultMethod · 0.95
FollowOrCancelMethod · 0.80

Tested by

no test coverage detected