service backend
This commit is contained in:
30
api/pkg/model/userdata.go
Normal file
30
api/pkg/model/userdata.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package model
|
||||
|
||||
type UserDataBase struct {
|
||||
Login string `bson:"login" json:"login"`
|
||||
Locale string `bson:"locale" json:"locale"`
|
||||
}
|
||||
|
||||
type LoginData struct {
|
||||
UserDataBase `bson:",inline" json:",inline"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type AccountData struct {
|
||||
LoginData `bson:",inline" json:",inline"`
|
||||
Name string `bson:"name" json:"name"`
|
||||
}
|
||||
|
||||
func (ad *AccountData) ToAccount() *Account {
|
||||
return &Account{
|
||||
AccountPublic: AccountPublic{
|
||||
AccountBase: AccountBase{
|
||||
Describable: Describable{
|
||||
Name: ad.Name,
|
||||
},
|
||||
},
|
||||
UserDataBase: ad.UserDataBase,
|
||||
},
|
||||
Password: ad.Password,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user