作者 yangfu

用户企业模块修改

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