fix: add created_at field on user profile
This commit is contained in:
parent
efab193793
commit
d7fa8496b0
@ -20,6 +20,7 @@ func (a *accessor) GetUsers() ([]userdomain.UserProfile, error) {
|
||||
Email: user.Email,
|
||||
Phone: user.Phone,
|
||||
Subscribe: user.Subscribe,
|
||||
CreatedAt: user.CreatedAt,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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"`
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user