12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- package request
- import "time"
- type AdminUserProfile struct {
- ID int64 `gorm:"primary_key;not_null;auto_increment;" json:"id"`
- UserID uint `json:"user_id"`
- Avatar string `json:"avatar"`
- PhoneNumber string `json:"phone_number"`
- Email string `json:"email"`
- Bio string `json:"bio"`
- Birthdate time.Time `json:"birthdate"`
- Gender int `json:"gender"`
- Address string `json:"address"`
- Website string `json:"website"`
- SocialLinks []AdminUserProfileSocialLink `gorm:"ForeignKey:ProfileID" json:"social_links"`
- Educations []AdminUserProfileEducation `gorm:"ForeignKey:ProfileID" json:"educations"`
- WorkHistories []AdminUserProfileWorkHistory `gorm:"ForeignKey:ProfileID" json:"work_histories"` // 多对多关系,例如用户的工作经历
- CreatedAt time.Time
- UpdatedAt time.Time
- }
- // UserProfileSocialLink 表示用户的社交链接
- type AdminUserProfileSocialLink struct {
- ID int64 `gorm:"primary_key;not_null;auto_increment;" json:"id"`
- ProfileID uint `json:"profile_id"`
- URL string `json:"url"`
- Platform string `json:"platform"`
- }
- // UserProfileEducation 表示用户的教育经历
- type AdminUserProfileEducation struct {
- ID int64 `gorm:"primary_key;not_null;auto_increment;" json:"id"`
- ProfileID uint `json:"profile_id"`
- School string `json:"school"`
- Degree string `json:"degree"`
- Graduated time.Time `json:"graduated"`
- }
- // UserProfileWorkHistory 表示用户的工作经历
- type AdminUserProfileWorkHistory struct {
- ID int64 `gorm:"primary_key;not_null;auto_increment;" json:"id"`
- ProfileID uint `json:"profile_id"`
- Company string `json:"company"`
- Position string `json:"position"`
- StartDate time.Time `json:"start_date"`
- EndDate time.Time `json:"end_date"`
- Responsibilities string `json:"responsibilities"`
- }
|