...
|
...
|
@@ -28,12 +28,14 @@ func (repo *UserRepository) Insert(user *domain.User) (*domain.User, error) { |
|
|
AvatarUrl: user.AvatarUrl,
|
|
|
CompanyId: user.CompanyId,
|
|
|
AdminType: user.AdminType,
|
|
|
DepartmentId: user.DepartmentId,
|
|
|
PositionId: user.PositionId,
|
|
|
Name: user.Name,
|
|
|
Email: user.Email,
|
|
|
Status: user.Status,
|
|
|
UpdatedAt: user.UpdatedAt,
|
|
|
DepartmentId: user.DepartmentId,
|
|
|
PositionId: user.PositionId,
|
|
|
EntryTime: user.EntryTime,
|
|
|
CreatedAt: user.CreatedAt,
|
|
|
UpdatedAt: user.UpdatedAt,
|
|
|
DeletedAt: user.DeletedAt,
|
|
|
}
|
|
|
tx := repo.transactionContext.PgTx
|
...
|
...
|
@@ -52,13 +54,14 @@ func (repo *UserRepository) Update(user *domain.User) (*domain.User, error) { |
|
|
AvatarUrl: user.AvatarUrl,
|
|
|
CompanyId: user.CompanyId,
|
|
|
AdminType: user.AdminType,
|
|
|
DepartmentId: user.DepartmentId,
|
|
|
PositionId: user.PositionId,
|
|
|
Name: user.Name,
|
|
|
Email: user.Email,
|
|
|
Status: user.Status,
|
|
|
UpdatedAt: user.UpdatedAt,
|
|
|
DepartmentId: user.DepartmentId,
|
|
|
PositionId: user.PositionId,
|
|
|
EntryTime: user.EntryTime,
|
|
|
CreatedAt: user.CreatedAt,
|
|
|
UpdatedAt: user.UpdatedAt,
|
|
|
DeletedAt: user.DeletedAt,
|
|
|
}
|
|
|
tx := repo.transactionContext.PgTx
|
...
|
...
|
@@ -139,16 +142,19 @@ func (repo *UserRepository) Find(queryOptions map[string]interface{}) (int, []*d |
|
|
|
|
|
func (repo *UserRepository) TransformToUserDomain(user *models.User) *domain.User {
|
|
|
return &domain.User{
|
|
|
Id: user.Id,
|
|
|
Account: user.Account,
|
|
|
AvatarUrl: user.AvatarUrl,
|
|
|
CompanyId: user.CompanyId,
|
|
|
AdminType: user.AdminType,
|
|
|
Name: user.Name,
|
|
|
Email: user.Email,
|
|
|
Status: user.Status,
|
|
|
UpdatedAt: user.UpdatedAt,
|
|
|
CreatedAt: user.CreatedAt,
|
|
|
DeletedAt: user.DeletedAt,
|
|
|
Id: user.Id,
|
|
|
Account: user.Account,
|
|
|
AvatarUrl: user.AvatarUrl,
|
|
|
CompanyId: user.CompanyId,
|
|
|
AdminType: user.AdminType,
|
|
|
Name: user.Name,
|
|
|
Email: user.Email,
|
|
|
Status: user.Status,
|
|
|
DepartmentId: user.DepartmentId,
|
|
|
PositionId: user.PositionId,
|
|
|
EntryTime: user.EntryTime,
|
|
|
UpdatedAt: user.UpdatedAt,
|
|
|
DeletedAt: user.DeletedAt,
|
|
|
CreatedAt: user.CreatedAt,
|
|
|
}
|
|
|
} |
...
|
...
|
|