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

@ -6,11 +6,12 @@ import (
)
type User struct {
ID string `json:"id"`
SubscribeID string `json:"subscribe_id"`
Password string `json:"password"`
Email string `json:"email"`
Phone string `json:"phone"`
ID string `json:"id"`
SubscribeID string `json:"subscribe_id"`
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"`
}
@ -23,9 +24,10 @@ type UserRegister struct {
}
type UserProfile struct {
ID string `json:"id"`
Email string `json:"email"`
Phone string `json:"phone"`
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"`
}