FollowUser 关注用户
(ctx context.Context, followerID, followeeID int64)
| 35 | |
| 36 | // FollowUser 关注用户 |
| 37 | func (r *relationRepository) FollowUser(ctx context.Context, followerID, followeeID int64) error { |
| 38 | // 关注成功后清除相关缓存 |
| 39 | if err := r.dao.FollowUser(ctx, followerID, followeeID); err != nil { |
| 40 | return err |
| 41 | } |
| 42 | r.cache.ClearFollowCache(ctx, followerID, followeeID) |
| 43 | |
| 44 | return nil |
| 45 | } |
| 46 | |
| 47 | func (r *relationRepository) CancelFollowUser(ctx context.Context, followerID, followeeID int64) error { |
| 48 | // 取消关注后清除相关缓存 |
nothing calls this directly
no test coverage detected