UpdateStatus 更新关系状态
(ctx context.Context, followerID, followeeID int64, status bool)
| 161 | |
| 162 | // UpdateStatus 更新关系状态 |
| 163 | func (r *relationDAO) UpdateStatus(ctx context.Context, followerID, followeeID int64, status bool) error { |
| 164 | if err := r.db.WithContext(ctx).Where("follower_id = ? AND followee_id = ?", followerID, followeeID).Updates(map[string]any{ |
| 165 | "status": status, |
| 166 | "updated_at": r.getCurrentTime(), |
| 167 | }).Error; err != nil { |
| 168 | r.l.Error("failed to update status", zap.Error(err)) |
| 169 | return err |
| 170 | } |
| 171 | |
| 172 | return nil |
| 173 | } |
| 174 | |
| 175 | // FollowCount 获取用户的关注和粉丝数量 |
| 176 | func (r *relationDAO) FollowCount(ctx context.Context, userID int64) (RelationCount, error) { |
nothing calls this directly
no test coverage detected