fix: add created_at field on user profile

This commit is contained in:
ericprd 2025-03-17 22:50:37 +08:00
parent efab193793
commit d7fa8496b0
3 changed files with 12 additions and 8 deletions

View File

@ -20,6 +20,7 @@ func (a *accessor) GetUsers() ([]userdomain.UserProfile, error) {
Email: user.Email,
Phone: user.Phone,
Subscribe: user.Subscribe,
CreatedAt: user.CreatedAt,
})
}

View File

@ -25,6 +25,7 @@ func (ur *accessor) GetUserProfile(id string) (*userdomain.UserProfile, error) {
Email: user.Email,
Phone: user.Phone,
Subscribe: user.Subscribe,
CreatedAt: user.CreatedAt,
}
return userProfile, nil

View File

@ -11,6 +11,7 @@ type User struct {
Password string `json:"password"`
Email string `json:"email"`
Phone string `json:"phone"`
CreatedAt time.Time `json:"created_at"`
Subscribe subscribe.Subscribe `gorm:"foreignKey:SubscribeID" json:"subscribe"`
}
@ -26,6 +27,7 @@ type UserProfile struct {
ID string `json:"id"`
Email string `json:"email"`
Phone string `json:"phone"`
CreatedAt time.Time `json:"created_at"`
Subscribe subscribe.Subscribe `gorm:"foreignKey:SubscribeID" json:"subscribe"`
}