...
|
...
|
@@ -13,21 +13,21 @@ type PgAuthAccountDestroyService struct { |
|
|
transactionContext *pgTransaction.TransactionContext
|
|
|
}
|
|
|
|
|
|
func (ptr *PgAuthAccountDestroyService) DestroyAccount(optUser *domain.User, userId int64) error {
|
|
|
func (ptr *PgAuthAccountDestroyService) DestroyAccount(optUser *domain.User, account string) error {
|
|
|
// 1.查询账号记录
|
|
|
userRepository, _ := repository.NewUserRepository(ptr.transactionContext)
|
|
|
var userBaseId int64
|
|
|
if user, err := userRepository.FindOne(map[string]interface{}{"userId": userId}); err != nil {
|
|
|
if err == domain.ErrorNotFound {
|
|
|
return fmt.Errorf("该用户不存在")
|
|
|
}
|
|
|
return err
|
|
|
} else {
|
|
|
userBaseId = user.UserBaseId
|
|
|
}
|
|
|
//var userBaseId int64
|
|
|
//if user, err := userRepository.FindOne(map[string]interface{}{"userId": userId}); err != nil {
|
|
|
// if err == domain.ErrorNotFound {
|
|
|
// return fmt.Errorf("该用户不存在")
|
|
|
// }
|
|
|
// return err
|
|
|
//} else {
|
|
|
// userBaseId = user.UserBaseId
|
|
|
//}
|
|
|
|
|
|
userBaseRepository, _ := repository.NewUserBaseRepository(ptr.transactionContext)
|
|
|
userBase, err := userBaseRepository.FindOne(map[string]interface{}{"userBaseId": userBaseId})
|
|
|
userBase, err := userBaseRepository.FindOne(map[string]interface{}{"account": account})
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
...
|
...
|
|