Add bio field and daily streak check-in for gamification
- User.Bio: a short (300 char) freeform profile bio, editable via PATCH /profile/bio, shown on discover cards and candidate detail (richer profiles beyond the fixed onboarding fields). - User.StreakCount/LastActiveDate: POST /profile/checkin increments the streak on consecutive days, resets after a gap, no-ops if already checked in today. Backs a daily-return hook on the frontend.
This commit is contained in:
@@ -49,4 +49,6 @@ type UserProfile struct {
|
||||
State string `json:"state"`
|
||||
BlockedReason *string `json:"blocked_reason,omitempty"`
|
||||
BlockedAt *time.Time `json:"blocked_at,omitempty"`
|
||||
Bio *string `json:"bio,omitempty"`
|
||||
StreakCount int `json:"streak_count"`
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ type DiscoverCandidate struct {
|
||||
ID uint `json:"id"`
|
||||
FirstName string `json:"first_name"`
|
||||
Age int `json:"age"`
|
||||
Bio string `json:"bio,omitempty"`
|
||||
Photos []string `json:"photos"`
|
||||
DistanceKM *float64 `json:"distance_km,omitempty"`
|
||||
Interests []string `json:"interests,omitempty"`
|
||||
@@ -58,6 +59,7 @@ type CandidateDetail struct {
|
||||
ID uint `json:"id"`
|
||||
FirstName string `json:"first_name"`
|
||||
Age int `json:"age"`
|
||||
Bio string `json:"bio,omitempty"`
|
||||
Photos []string `json:"photos"`
|
||||
DistanceKM *float64 `json:"distance_km,omitempty"`
|
||||
HeightCM *int `json:"height_cm,omitempty"`
|
||||
|
||||
@@ -5,3 +5,14 @@ type UpdateLocationRequest struct {
|
||||
Latitude float64 `json:"latitude" binding:"required"`
|
||||
Longitude float64 `json:"longitude" binding:"required"`
|
||||
}
|
||||
|
||||
// UpdateBioRequest ویرایش بیوگرافی کوتاه پروفایل
|
||||
type UpdateBioRequest struct {
|
||||
Bio string `json:"bio" binding:"max=300"`
|
||||
}
|
||||
|
||||
// CheckInResult نتیجهی ثبت ورود روزانه (برای استریک گیمیفیکیشن)
|
||||
type CheckInResult struct {
|
||||
StreakCount int `json:"streak_count"`
|
||||
IsNewToday bool `json:"is_new_today"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user