Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bf24d929c
|
||
|
|
dcbc2609c4
|
@@ -1,18 +0,0 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"time"
|
||||
)
|
||||
|
||||
type UserLoginHistory struct {
|
||||
Id uuid.UUID `json:"id"`
|
||||
LoginTime time.Time `json:"login_time"`
|
||||
UserId uuid.UUID `json:"user_id"`
|
||||
}
|
||||
|
||||
type ServiceUserLoginHistory struct {
|
||||
Id uuid.UUID `json:"id"`
|
||||
LoginTime time.Time `json:"login_time"`
|
||||
ServiceUserId uuid.UUID `json:"service_user_id"`
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package user
|
||||
|
||||
|
||||
type UserProfile struct {
|
||||
Usr *User `json:"user"`
|
||||
}
|
||||
|
||||
func InitUserProfile(usr *User) (usrProfile *UserProfile, done bool) {
|
||||
if usr == nil {
|
||||
return nil, false
|
||||
} else {
|
||||
if len(usr.Password) > 0 {
|
||||
var newUsr User
|
||||
newUsr := *usr
|
||||
newUsr.Password = ""
|
||||
usrProfile.Usr = &newUsr
|
||||
|
||||
return usrProfile, true
|
||||
} else {
|
||||
usrProfile.Usr = usr
|
||||
return usrProfile, true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user