MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / FollowUser

Method FollowUser

internal/api/relation.go:71–90  ·  view source on GitHub ↗

FollowUser 处理关注用户的请求

(ctx *gin.Context, req req.FollowUserReq)

Source from the content-addressed store, hash-verified

69
70// FollowUser 处理关注用户的请求
71func (r *RelationHandler) FollowUser(ctx *gin.Context, req req.FollowUserReq) (Result, error) {
72 uc, ok := requireUser(ctx)
73 if !ok {
74 return Result{
75 Code: FollowUserERRORCode,
76 Msg: "未登录或登录已过期",
77 }, nil
78 }
79
80 if err := r.svc.FollowUser(ctx, uc.Uid, req.FolloweeID); err != nil {
81 return Result{
82 Code: FollowUserERRORCode,
83 Msg: FollowUserERRORMsg,
84 }, err
85 }
86 return Result{
87 Code: RequestsOK,
88 Msg: FollowUserSuccessMsg,
89 }, nil
90}
91
92func (r *RelationHandler) CancelFollowUser(ctx *gin.Context, req req.CancelFollowUserReq) (Result, error) {
93 uc, ok := requireUser(ctx)

Callers

nothing calls this directly

Calls 2

requireUserFunction · 0.85
FollowUserMethod · 0.65

Tested by

no test coverage detected