...
|
...
|
@@ -55,7 +55,7 @@ func (reponsitory AdminUserRepository) FindOne(queryOption domain.AdminUserFindO |
|
|
return &adminUser, err
|
|
|
}
|
|
|
|
|
|
func (reponsitory AdminUserRepository) updateAdminUser(adminuser *domain.AdminUser) (*domain.AdminUser, error) {
|
|
|
func (reponsitory AdminUserRepository) updateAdminUser(adminuser domain.AdminUser) (*domain.AdminUser, error) {
|
|
|
tx := reponsitory.transactionContext.PgTx
|
|
|
adminUserModel := &models.AdminUser{
|
|
|
Id: adminuser.Id,
|
...
|
...
|
@@ -72,10 +72,10 @@ func (reponsitory AdminUserRepository) updateAdminUser(adminuser *domain.AdminUs |
|
|
if err != nil {
|
|
|
return nil, fmt.Errorf("更新用户数据失败:%s", err)
|
|
|
}
|
|
|
return adminuser, nil
|
|
|
return &adminuser, nil
|
|
|
}
|
|
|
|
|
|
func (reponsitory AdminUserRepository) addAdminUser(adminuser *domain.AdminUser) (*domain.AdminUser, error) {
|
|
|
func (reponsitory AdminUserRepository) addAdminUser(adminuser domain.AdminUser) (*domain.AdminUser, error) {
|
|
|
tx := reponsitory.transactionContext.PgTx
|
|
|
adminuserModel := &models.AdminUser{
|
|
|
Account: adminuser.Account,
|
...
|
...
|
@@ -93,13 +93,11 @@ func (reponsitory AdminUserRepository) addAdminUser(adminuser *domain.AdminUser) |
|
|
return nil, nil
|
|
|
}
|
|
|
|
|
|
func (reponsitory AdminUserRepository) Save(adminuser *domain.AdminUser) (*domain.AdminUser, error) {
|
|
|
func (reponsitory AdminUserRepository) Save(adminuser domain.AdminUser) (*domain.AdminUser, error) {
|
|
|
if adminuser.Id == 0 {
|
|
|
return reponsitory.addAdminUser(adminuser)
|
|
|
} else {
|
|
|
return reponsitory.updateAdminUser(adminuser)
|
|
|
}
|
|
|
return adminuser, nil
|
|
|
return reponsitory.updateAdminUser(adminuser)
|
|
|
}
|
|
|
|
|
|
func (reponsitory AdminUserRepository) Find(queryOption domain.AdminUserFindQuery) ([]domain.AdminUser, error) {
|
...
|
...
|
|