From 748fe31cfe9e8d68d242ea11895e8842cde5ef85 Mon Sep 17 00:00:00 2001 From: fansili Date: Fri, 8 May 2020 10:43:54 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BC=98=E5=8C=96=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20pom=E4=BB=A5=E6=9D=A5=20-=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=EF=BC=9AsystemError=20=E6=94=B9=E4=B8=BA=20useError?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- user/user-biz-api/pom.xml | 9 ++++++++- user/user-biz/pom.xml | 2 +- .../user/biz/service/user/UserAddressServiceImpl.java | 8 ++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/user/user-biz-api/pom.xml b/user/user-biz-api/pom.xml index 85d7f33a..fec19c09 100644 --- a/user/user-biz-api/pom.xml +++ b/user/user-biz-api/pom.xml @@ -11,5 +11,12 @@ user-biz-api - + + + + cn.iocoder.mall + common-framework + 1.0-SNAPSHOT + + \ No newline at end of file diff --git a/user/user-biz/pom.xml b/user/user-biz/pom.xml index 50b38c0a..0fb88e04 100644 --- a/user/user-biz/pom.xml +++ b/user/user-biz/pom.xml @@ -16,7 +16,7 @@ cn.iocoder.mall - system-biz-api + user-biz-api 1.0-SNAPSHOT diff --git a/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/service/user/UserAddressServiceImpl.java b/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/service/user/UserAddressServiceImpl.java index 6c54db9d..90627bc2 100644 --- a/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/service/user/UserAddressServiceImpl.java +++ b/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/service/user/UserAddressServiceImpl.java @@ -2,13 +2,13 @@ package cn.iocoder.mall.user.biz.service.user; import cn.iocoder.common.framework.util.ServiceExceptionUtil; import cn.iocoder.mall.mybatis.enums.DeletedStatusEnum; -import cn.iocoder.mall.system.biz.enums.SystemErrorCodeEnum; import cn.iocoder.mall.user.biz.bo.user.UserAddressBO; import cn.iocoder.mall.user.biz.convert.user.UserAddressConvert; import cn.iocoder.mall.user.biz.dao.user.UserAddressMapper; import cn.iocoder.mall.user.biz.dataobject.user.UsersUserAddressDO; import cn.iocoder.mall.user.biz.dto.user.UserAddressAddDTO; import cn.iocoder.mall.user.biz.dto.user.UserAddressUpdateDTO; +import cn.iocoder.mall.user.biz.enums.UserErrorCodeEnum; import cn.iocoder.mall.user.biz.enums.user.UserAddressHasDefaultEnum; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -62,12 +62,12 @@ public class UserAddressServiceImpl implements UserAddressService { UsersUserAddressDO userAddress = userAddressMapper.selectById(userAddressAddDTO.getId()); if (userAddress == null) { - throw ServiceExceptionUtil.exception(SystemErrorCodeEnum.USER_ADDRESS_NOT_EXISTENT.getCode()); + throw ServiceExceptionUtil.exception(UserErrorCodeEnum.USER_ADDRESS_NOT_EXISTENT.getCode()); } // 删除的地址不能更新 if (DeletedStatusEnum.DELETED_YES.getValue().equals(userAddress.getDeleted())) { - throw ServiceExceptionUtil.exception(SystemErrorCodeEnum.USER_ADDRESS_IS_DELETED.getCode()); + throw ServiceExceptionUtil.exception(UserErrorCodeEnum.USER_ADDRESS_IS_DELETED.getCode()); } // 检查是否设置为默认地址 @@ -95,7 +95,7 @@ public class UserAddressServiceImpl implements UserAddressService { UsersUserAddressDO userAddress = userAddressMapper.selectById(addressId); if (userAddress == null) { - throw ServiceExceptionUtil.exception(SystemErrorCodeEnum.USER_ADDRESS_NOT_EXISTENT.getCode()); + throw ServiceExceptionUtil.exception(UserErrorCodeEnum.USER_ADDRESS_NOT_EXISTENT.getCode()); } if (DeletedStatusEnum.DELETED_YES.getValue().equals(userAddress.getDeleted())) {