Initial commit: dating app backend (Go/Gin/GORM/Postgres)

Phone+OTP auth, staged onboarding, admin approval workflow, and a
full discovery/swipe/match/chat system with photo upload and
approximate distance (haversine) based on user location.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 23:23:47 +03:30
commit 2823fb45f5
49 changed files with 4582 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
package models
import "time"
// ProfileQuestion سوالاتی که ادمین از پیش در پنل وارد می‌کند
// (مثلاً «بزرگ‌ترین درسی که از زندگی گرفتی چیه؟») و کاربر باید
// دقیقاً ۳ تا از آن‌ها را انتخاب و برایش پاسخ بنویسد.
type ProfileQuestion struct {
ID uint `gorm:"primaryKey" json:"id"`
Text string `gorm:"size:255;not null" json:"text"`
SortOrder int `gorm:"default:0;not null" json:"sort_order"`
IsActive bool `gorm:"default:true;not null" json:"is_active"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (ProfileQuestion) TableName() string {
return "profile_questions"
}
// UserProfileAnswer پاسخ کاربر به یکی از سوالات انتخابی
type UserProfileAnswer struct {
ID uint `gorm:"primaryKey" json:"id"`
UserID uint `gorm:"not null;uniqueIndex:idx_user_question" json:"user_id"`
QuestionID uint `gorm:"not null;uniqueIndex:idx_user_question" json:"question_id"`
Answer string `gorm:"type:text;not null" json:"answer"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Question *ProfileQuestion `gorm:"foreignKey:QuestionID" json:"question,omitempty"`
}
func (UserProfileAnswer) TableName() string {
return "user_profile_answers"
}