|
@@ -55,7 +55,7 @@ func (reponsitory AdminUserRepository) FindOne(queryOption domain.AdminUserFindO |
|
@@ -55,7 +55,7 @@ func (reponsitory AdminUserRepository) FindOne(queryOption domain.AdminUserFindO |
55
|
return &adminUser, err
|
55
|
return &adminUser, err
|
56
|
}
|
56
|
}
|
57
|
|
57
|
|
58
|
-func (reponsitory AdminUserRepository) updateAdminUser(adminuser *domain.AdminUser) (*domain.AdminUser, error) {
|
58
|
+func (reponsitory AdminUserRepository) updateAdminUser(adminuser domain.AdminUser) (*domain.AdminUser, error) {
|
59
|
tx := reponsitory.transactionContext.PgTx
|
59
|
tx := reponsitory.transactionContext.PgTx
|
60
|
adminUserModel := &models.AdminUser{
|
60
|
adminUserModel := &models.AdminUser{
|
61
|
Id: adminuser.Id,
|
61
|
Id: adminuser.Id,
|
|
@@ -72,10 +72,10 @@ func (reponsitory AdminUserRepository) updateAdminUser(adminuser *domain.AdminUs |
|
@@ -72,10 +72,10 @@ func (reponsitory AdminUserRepository) updateAdminUser(adminuser *domain.AdminUs |
72
|
if err != nil {
|
72
|
if err != nil {
|
73
|
return nil, fmt.Errorf("更新用户数据失败:%s", err)
|
73
|
return nil, fmt.Errorf("更新用户数据失败:%s", err)
|
74
|
}
|
74
|
}
|
75
|
- return adminuser, nil
|
75
|
+ return &adminuser, nil
|
76
|
}
|
76
|
}
|
77
|
|
77
|
|
78
|
-func (reponsitory AdminUserRepository) addAdminUser(adminuser *domain.AdminUser) (*domain.AdminUser, error) {
|
78
|
+func (reponsitory AdminUserRepository) addAdminUser(adminuser domain.AdminUser) (*domain.AdminUser, error) {
|
79
|
tx := reponsitory.transactionContext.PgTx
|
79
|
tx := reponsitory.transactionContext.PgTx
|
80
|
adminuserModel := &models.AdminUser{
|
80
|
adminuserModel := &models.AdminUser{
|
81
|
Account: adminuser.Account,
|
81
|
Account: adminuser.Account,
|
|
@@ -93,13 +93,11 @@ func (reponsitory AdminUserRepository) addAdminUser(adminuser *domain.AdminUser) |
|
@@ -93,13 +93,11 @@ func (reponsitory AdminUserRepository) addAdminUser(adminuser *domain.AdminUser) |
93
|
return nil, nil
|
93
|
return nil, nil
|
94
|
}
|
94
|
}
|
95
|
|
95
|
|
96
|
-func (reponsitory AdminUserRepository) Save(adminuser *domain.AdminUser) (*domain.AdminUser, error) {
|
96
|
+func (reponsitory AdminUserRepository) Save(adminuser domain.AdminUser) (*domain.AdminUser, error) {
|
97
|
if adminuser.Id == 0 {
|
97
|
if adminuser.Id == 0 {
|
98
|
return reponsitory.addAdminUser(adminuser)
|
98
|
return reponsitory.addAdminUser(adminuser)
|
99
|
- } else {
|
|
|
100
|
- return reponsitory.updateAdminUser(adminuser)
|
|
|
101
|
}
|
99
|
}
|
102
|
- return adminuser, nil
|
100
|
+ return reponsitory.updateAdminUser(adminuser)
|
103
|
}
|
101
|
}
|
104
|
|
102
|
|
105
|
func (reponsitory AdminUserRepository) Find(queryOption domain.AdminUserFindQuery) ([]domain.AdminUser, error) {
|
103
|
func (reponsitory AdminUserRepository) Find(queryOption domain.AdminUserFindQuery) ([]domain.AdminUser, error) {
|