feat(ECR-011): 昵称、首页贴士与档案 Self 唯一/合盘交叉校验
每账号仅一条 self(migration 40902);合盘只选 TA;账号昵称可改;首页穿衣/颜色/养生贴士。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -97,6 +97,14 @@ func (r *AuthRepo) CreateUserWithPhone(ctx context.Context, phone, hash, nicknam
|
||||
return id, err
|
||||
}
|
||||
|
||||
// UpdateNickname sets users.nickname (non-empty).
|
||||
func (r *AuthRepo) UpdateNickname(ctx context.Context, userID uuid.UUID, nickname string) error {
|
||||
_, err := r.Pool.Exec(ctx, `
|
||||
UPDATE users SET nickname=$2, updated_at=now()
|
||||
WHERE id=$1 AND deleted_at IS NULL`, userID, nickname)
|
||||
return err
|
||||
}
|
||||
|
||||
// TouchPassword updates stored password hash (open-login record).
|
||||
func (r *AuthRepo) TouchPassword(ctx context.Context, userID uuid.UUID, hash string) error {
|
||||
_, err := r.Pool.Exec(ctx, `
|
||||
|
||||
Reference in New Issue
Block a user