feat: add private and profile

This commit is contained in:
2026-06-17 11:32:51 +03:30
parent 02060a4dc0
commit 0827858752
23 changed files with 972 additions and 25 deletions
+8
View File
@@ -52,6 +52,14 @@ func (r *Repo) Create(ctx context.Context, mobile string) (*User, error) {
return r.FindByID(ctx, id)
}
// UpdateProfile نام نمایشی و آواتار کاربر را تنظیم می‌کند.
func (r *Repo) UpdateProfile(ctx context.Context, id int64, firstName, avatar string) error {
_, err := r.db.ExecContext(ctx,
`UPDATE users SET first_name = ?, avatar = ? WHERE id = ?`,
firstName, avatar, id)
return err
}
// FindOrCreate اگر کاربر نبود می‌سازد (مطابق فلوی login-otp).
func (r *Repo) FindOrCreate(ctx context.Context, mobile string) (*User, error) {
u, err := r.FindByMobile(ctx, mobile)