作者 yangfu

用户企业模块修改

@@ -14,7 +14,7 @@ type GetCompanyQuery struct { @@ -14,7 +14,7 @@ type GetCompanyQuery struct {
14 } 14 }
15 15
16 func (getCompanyQuery *GetCompanyQuery) Valid(validation *validation.Validation) { 16 func (getCompanyQuery *GetCompanyQuery) Valid(validation *validation.Validation) {
17 - validation.SetError("CustomValid", "未实现的自定义认证") 17 + //validation.SetError("CustomValid", "未实现的自定义认证")
18 } 18 }
19 19
20 func (getCompanyQuery *GetCompanyQuery) ValidateQuery() error { 20 func (getCompanyQuery *GetCompanyQuery) ValidateQuery() error {
@@ -16,7 +16,7 @@ type ListCompanyQuery struct { @@ -16,7 +16,7 @@ type ListCompanyQuery struct {
16 } 16 }
17 17
18 func (listCompanyQuery *ListCompanyQuery) Valid(validation *validation.Validation) { 18 func (listCompanyQuery *ListCompanyQuery) Valid(validation *validation.Validation) {
19 - validation.SetError("CustomValid", "未实现的自定义认证") 19 + //validation.SetError("CustomValid", "未实现的自定义认证")
20 } 20 }
21 21
22 func (listCompanyQuery *ListCompanyQuery) ValidateQuery() error { 22 func (listCompanyQuery *ListCompanyQuery) ValidateQuery() error {
@@ -16,11 +16,11 @@ type UpdateUsersBaseCommand struct { @@ -16,11 +16,11 @@ type UpdateUsersBaseCommand struct {
16 // 用户姓名 16 // 用户姓名
17 UserName string `cname:"用户姓名" json:"userName" valid:"Required"` 17 UserName string `cname:"用户姓名" json:"userName" valid:"Required"`
18 // 头像 18 // 头像
19 - Avatar string `cname:"头像" json:"avatar" valid:"Required"` 19 + Avatar string `cname:"头像" json:"avatar"`
20 // 手机号码 20 // 手机号码
21 Phone string `cname:"手机号码" json:"phone" valid:"Required"` 21 Phone string `cname:"手机号码" json:"phone" valid:"Required"`
22 // 邮箱 22 // 邮箱
23 - Email string `cname:"邮箱" json:"email" valid:"Required"` 23 + Email string `cname:"邮箱" json:"email"`
24 } 24 }
25 25
26 func (updateUsersBaseCommand *UpdateUsersBaseCommand) Valid(validation *validation.Validation) { 26 func (updateUsersBaseCommand *UpdateUsersBaseCommand) Valid(validation *validation.Validation) {
@@ -2,6 +2,7 @@ package dto @@ -2,6 +2,7 @@ package dto
2 2
3 import ( 3 import (
4 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/domain" 4 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/domain"
  5 + "time"
5 ) 6 )
6 7
7 type UserDto struct { 8 type UserDto struct {
@@ -32,6 +33,8 @@ type UserDto struct { @@ -32,6 +33,8 @@ type UserDto struct {
32 // 部门 33 // 部门
33 Department *domain.Department `json:"department,omitempty"` 34 Department *domain.Department `json:"department,omitempty"`
34 Im *domain.Im `json:"im,omitempty"` 35 Im *domain.Im `json:"im,omitempty"`
  36 + // 创建时间
  37 + CreatedAt time.Time `json:"createdAt,omitempty"`
35 } 38 }
36 39
37 type Company struct { 40 type Company struct {
@@ -77,5 +80,6 @@ func (dto *UserDto) LoadDto(user *domain.User, company *domain.Company) error { @@ -77,5 +80,6 @@ func (dto *UserDto) LoadDto(user *domain.User, company *domain.Company) error {
77 } 80 }
78 dto.Organization = user.Organization 81 dto.Organization = user.Organization
79 dto.Department = user.Department 82 dto.Department = user.Department
  83 + dto.CreatedAt = user.CreatedAt
80 return nil 84 return nil
81 } 85 }
@@ -322,7 +322,7 @@ func (userService *UserService) GetUser(getUserQuery *query.GetUserQuery) (inter @@ -322,7 +322,7 @@ func (userService *UserService) GetUser(getUserQuery *query.GetUserQuery) (inter
322 _, org, _ := factory.FastPgOrg(transactionContext, user.OrganizationId) 322 _, org, _ := factory.FastPgOrg(transactionContext, user.OrganizationId)
323 _, company, _ := factory.FastPgCompany(transactionContext, user.CompanyId) 323 _, company, _ := factory.FastPgCompany(transactionContext, user.CompanyId)
324 _, userBase, _ := factory.FastPgUserBase(transactionContext, user.UserBaseId) 324 _, userBase, _ := factory.FastPgUserBase(transactionContext, user.UserBaseId)
325 - if dep != nil && org != nil && company != nil && userBase != nil { 325 + if dep != nil && org != nil && userBase != nil {
326 user.Department = dep.ConvDep() 326 user.Department = dep.ConvDep()
327 user.Organization = org.CloneSample() 327 user.Organization = org.CloneSample()
328 user.Company = company.CloneSample() 328 user.Company = company.CloneSample()