|
@@ -28,12 +28,14 @@ func (repo *UserRepository) Insert(user *domain.User) (*domain.User, error) { |
|
@@ -28,12 +28,14 @@ func (repo *UserRepository) Insert(user *domain.User) (*domain.User, error) { |
28
|
AvatarUrl: user.AvatarUrl,
|
28
|
AvatarUrl: user.AvatarUrl,
|
29
|
CompanyId: user.CompanyId,
|
29
|
CompanyId: user.CompanyId,
|
30
|
AdminType: user.AdminType,
|
30
|
AdminType: user.AdminType,
|
31
|
- DepartmentId: user.DepartmentId,
|
|
|
32
|
- PositionId: user.PositionId,
|
|
|
33
|
Name: user.Name,
|
31
|
Name: user.Name,
|
|
|
32
|
+ Email: user.Email,
|
34
|
Status: user.Status,
|
33
|
Status: user.Status,
|
35
|
- UpdatedAt: user.UpdatedAt,
|
34
|
+ DepartmentId: user.DepartmentId,
|
|
|
35
|
+ PositionId: user.PositionId,
|
|
|
36
|
+ EntryTime: user.EntryTime,
|
36
|
CreatedAt: user.CreatedAt,
|
37
|
CreatedAt: user.CreatedAt,
|
|
|
38
|
+ UpdatedAt: user.UpdatedAt,
|
37
|
DeletedAt: user.DeletedAt,
|
39
|
DeletedAt: user.DeletedAt,
|
38
|
}
|
40
|
}
|
39
|
tx := repo.transactionContext.PgTx
|
41
|
tx := repo.transactionContext.PgTx
|
|
@@ -52,13 +54,14 @@ func (repo *UserRepository) Update(user *domain.User) (*domain.User, error) { |
|
@@ -52,13 +54,14 @@ func (repo *UserRepository) Update(user *domain.User) (*domain.User, error) { |
52
|
AvatarUrl: user.AvatarUrl,
|
54
|
AvatarUrl: user.AvatarUrl,
|
53
|
CompanyId: user.CompanyId,
|
55
|
CompanyId: user.CompanyId,
|
54
|
AdminType: user.AdminType,
|
56
|
AdminType: user.AdminType,
|
55
|
- DepartmentId: user.DepartmentId,
|
|
|
56
|
- PositionId: user.PositionId,
|
|
|
57
|
Name: user.Name,
|
57
|
Name: user.Name,
|
58
|
Email: user.Email,
|
58
|
Email: user.Email,
|
59
|
Status: user.Status,
|
59
|
Status: user.Status,
|
60
|
- UpdatedAt: user.UpdatedAt,
|
60
|
+ DepartmentId: user.DepartmentId,
|
|
|
61
|
+ PositionId: user.PositionId,
|
|
|
62
|
+ EntryTime: user.EntryTime,
|
61
|
CreatedAt: user.CreatedAt,
|
63
|
CreatedAt: user.CreatedAt,
|
|
|
64
|
+ UpdatedAt: user.UpdatedAt,
|
62
|
DeletedAt: user.DeletedAt,
|
65
|
DeletedAt: user.DeletedAt,
|
63
|
}
|
66
|
}
|
64
|
tx := repo.transactionContext.PgTx
|
67
|
tx := repo.transactionContext.PgTx
|
|
@@ -139,16 +142,19 @@ func (repo *UserRepository) Find(queryOptions map[string]interface{}) (int, []*d |
|
@@ -139,16 +142,19 @@ func (repo *UserRepository) Find(queryOptions map[string]interface{}) (int, []*d |
139
|
|
142
|
|
140
|
func (repo *UserRepository) TransformToUserDomain(user *models.User) *domain.User {
|
143
|
func (repo *UserRepository) TransformToUserDomain(user *models.User) *domain.User {
|
141
|
return &domain.User{
|
144
|
return &domain.User{
|
142
|
- Id: user.Id,
|
|
|
143
|
- Account: user.Account,
|
|
|
144
|
- AvatarUrl: user.AvatarUrl,
|
|
|
145
|
- CompanyId: user.CompanyId,
|
|
|
146
|
- AdminType: user.AdminType,
|
|
|
147
|
- Name: user.Name,
|
|
|
148
|
- Email: user.Email,
|
|
|
149
|
- Status: user.Status,
|
|
|
150
|
- UpdatedAt: user.UpdatedAt,
|
|
|
151
|
- CreatedAt: user.CreatedAt,
|
|
|
152
|
- DeletedAt: user.DeletedAt,
|
145
|
+ Id: user.Id,
|
|
|
146
|
+ Account: user.Account,
|
|
|
147
|
+ AvatarUrl: user.AvatarUrl,
|
|
|
148
|
+ CompanyId: user.CompanyId,
|
|
|
149
|
+ AdminType: user.AdminType,
|
|
|
150
|
+ Name: user.Name,
|
|
|
151
|
+ Email: user.Email,
|
|
|
152
|
+ Status: user.Status,
|
|
|
153
|
+ DepartmentId: user.DepartmentId,
|
|
|
154
|
+ PositionId: user.PositionId,
|
|
|
155
|
+ EntryTime: user.EntryTime,
|
|
|
156
|
+ UpdatedAt: user.UpdatedAt,
|
|
|
157
|
+ DeletedAt: user.DeletedAt,
|
|
|
158
|
+ CreatedAt: user.CreatedAt,
|
153
|
}
|
159
|
}
|
154
|
} |
160
|
} |