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

Method UpdateStatus

internal/repository/dao/relation.go:163–173  ·  view source on GitHub ↗

UpdateStatus 更新关系状态

(ctx context.Context, followerID, followeeID int64, status bool)

Source from the content-addressed store, hash-verified

161
162// UpdateStatus 更新关系状态
163func (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 获取用户的关注和粉丝数量
176func (r *relationDAO) FollowCount(ctx context.Context, userID int64) (RelationCount, error) {

Callers

nothing calls this directly

Calls 1

getCurrentTimeMethod · 0.95

Tested by

no test coverage detected