enhance(user):完成可运行的程序基本结构以及用户基本查询功能。

This commit is contained in:
徐涛
2023-06-01 05:37:41 +08:00
parent 47cd27c968
commit 523e6215f4
4 changed files with 272 additions and 39 deletions

View File

@@ -23,6 +23,38 @@ type ManagementAccountCreationForm struct {
Expires Date
}
func (m ManagementAccountCreationForm) IntoUser() *User {
return &User{
Id: *m.Id,
Username: m.Username,
Password: "",
ResetNeeded: false,
UserType: m.Type,
Enabled: m.Enabled,
CreatedAt: nil,
}
}
func (m ManagementAccountCreationForm) IntoUserDetail() *UserDetail {
return &UserDetail{
Id: *m.Id,
Name: &m.Name,
Abbr: nil,
Region: nil,
Address: nil,
Contact: m.Contact,
Phone: m.Phone,
UnitServiceFee: decimal.Zero,
ServiceExpiration: m.Expires,
CreatedAt: time.Now(),
CreatedBy: nil,
LastModifiedAt: time.Now(),
LastModifiedBy: nil,
DeletedAt: nil,
DeletedBy: nil,
}
}
type User struct {
Id string
Username string