From 47d4d3f2dc4b79f6f413204b69f9f6437f847a0b Mon Sep 17 00:00:00 2001 From: cherishsince Date: Fri, 1 May 2020 10:48:27 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BC=98=E5=8C=96=EF=BC=9AuserErrorCode=20?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=20SystemErrorCode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/service/user/UserAddressServiceImpl.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/system/system-biz/src/main/java/cn/iocoder/mall/system/biz/service/user/UserAddressServiceImpl.java b/system/system-biz/src/main/java/cn/iocoder/mall/system/biz/service/user/UserAddressServiceImpl.java index 70cad2e8c..2de40fb8c 100644 --- a/system/system-biz/src/main/java/cn/iocoder/mall/system/biz/service/user/UserAddressServiceImpl.java +++ b/system/system-biz/src/main/java/cn/iocoder/mall/system/biz/service/user/UserAddressServiceImpl.java @@ -8,8 +8,8 @@ import cn.iocoder.mall.system.biz.dao.user.UserAddressMapper; import cn.iocoder.mall.system.biz.dataobject.user.UserAddressDO; import cn.iocoder.mall.system.biz.dto.user.UserAddressAddDTO; import cn.iocoder.mall.system.biz.dto.user.UserAddressUpdateDTO; -import cn.iocoder.mall.system.biz.enums.UserAddressHasDefaultEnum; -import cn.iocoder.mall.system.biz.enums.UserErrorCodeEnum; +import cn.iocoder.mall.system.biz.enums.userAddress.UserAddressHasDefaultEnum; +import cn.iocoder.mall.system.biz.enums.SystemErrorCodeEnum; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -59,11 +59,11 @@ public class UserAddressServiceImpl implements UserAddressService { .selectByUserIdAndId(userAddressAddDTO.getUserId(), userAddressAddDTO.getId()); if (DeletedStatusEnum.DELETED_YES.getValue().equals(userAddress.getDeleted())) { - throw ServiceExceptionUtil.exception(UserErrorCodeEnum.USER_ADDRESS_IS_DELETED.getCode()); + throw ServiceExceptionUtil.exception(SystemErrorCodeEnum.USER_ADDRESS_IS_DELETED.getCode()); } if (userAddress == null) { - throw ServiceExceptionUtil.exception(UserErrorCodeEnum.USER_ADDRESS_NOT_EXISTENT.getCode()); + throw ServiceExceptionUtil.exception(SystemErrorCodeEnum.USER_ADDRESS_NOT_EXISTENT.getCode()); } // 检查是否设置为默认地址 @@ -106,7 +106,7 @@ public class UserAddressServiceImpl implements UserAddressService { } if (userAddress == null) { - throw ServiceExceptionUtil.exception(UserErrorCodeEnum.USER_ADDRESS_NOT_EXISTENT.getCode()); + throw ServiceExceptionUtil.exception(SystemErrorCodeEnum.USER_ADDRESS_NOT_EXISTENT.getCode()); } userAddressMapper.updateById( @@ -131,11 +131,11 @@ public class UserAddressServiceImpl implements UserAddressService { public UserAddressBO getAddress(Integer userId, Integer id) { UserAddressDO userAddress = userAddressMapper.selectByUserIdAndId(userId, id); if (userAddress == null) { - throw ServiceExceptionUtil.exception(UserErrorCodeEnum.USER_GET_ADDRESS_NOT_EXISTS.getCode()); + throw ServiceExceptionUtil.exception(SystemErrorCodeEnum.USER_GET_ADDRESS_NOT_EXISTS.getCode()); } if (DeletedStatusEnum.DELETED_YES.getValue().equals(userAddress.getDeleted())) { - throw ServiceExceptionUtil.exception(UserErrorCodeEnum.USER_ADDRESS_IS_DELETED.getCode()); + throw ServiceExceptionUtil.exception(SystemErrorCodeEnum.USER_ADDRESS_IS_DELETED.getCode()); } UserAddressBO userAddressBO = UserAddressConvert.INSTANCE.convert(userAddress);