From 9da9a50b92041043165a55c33b8551f7aec936ea Mon Sep 17 00:00:00 2001 From: YunaiV <> Date: Wed, 6 May 2020 19:52:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=94=B6=E4=BB=B6=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E7=9A=84=E4=BB=A3=E7=A0=81=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iocoder/mall/user/biz/dataobject/user/UserAddressDO.java | 1 - .../mall/user/rpc/convert/user/UserAddressRPCConvert.java | 1 + .../main/java/cn/iocoder/mall/user/api/UserAddressService.java | 2 ++ .../cn/iocoder/mall/user/biz/dataobject/UserAddressDO.java | 3 +++ .../iocoder/mall/user/biz/service/UserAddressServiceImpl.java | 2 ++ 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/dataobject/user/UserAddressDO.java b/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/dataobject/user/UserAddressDO.java index 13422ac7c..b6112b911 100644 --- a/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/dataobject/user/UserAddressDO.java +++ b/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/dataobject/user/UserAddressDO.java @@ -12,7 +12,6 @@ import lombok.experimental.Accessors; */ @Data @Accessors(chain = true) -// TODO FROM 芋艿 to 小范:还是放在 user 服务,哈哈哈,我表述错了。 public class UserAddressDO extends DeletableDO { /** diff --git a/user/user-rpc/src/main/java/cn/iocoder/mall/user/rpc/convert/user/UserAddressRPCConvert.java b/user/user-rpc/src/main/java/cn/iocoder/mall/user/rpc/convert/user/UserAddressRPCConvert.java index 16557408d..5539d02a0 100644 --- a/user/user-rpc/src/main/java/cn/iocoder/mall/user/rpc/convert/user/UserAddressRPCConvert.java +++ b/user/user-rpc/src/main/java/cn/iocoder/mall/user/rpc/convert/user/UserAddressRPCConvert.java @@ -24,6 +24,7 @@ public interface UserAddressRPCConvert { UserAddressRPCConvert INSTANCE = Mappers.getMapper(UserAddressRPCConvert.class); + // TODO FROM 芋艿 to 小范:如果不用映射,可以不用 @Mappings 哈 @Mappings({}) UserAddressAddDTO convert(UserAddressAddRequest userAddressAddRequest); diff --git a/user/user-service-api/src/main/java/cn/iocoder/mall/user/api/UserAddressService.java b/user/user-service-api/src/main/java/cn/iocoder/mall/user/api/UserAddressService.java index cec76af71..207429be2 100644 --- a/user/user-service-api/src/main/java/cn/iocoder/mall/user/api/UserAddressService.java +++ b/user/user-service-api/src/main/java/cn/iocoder/mall/user/api/UserAddressService.java @@ -15,6 +15,8 @@ import java.util.List; */ public interface UserAddressService { + // TODO FROM 芋艿 to 小范:泛型哈。另外,Service 不用 CommonResult 返回 + CommonResult addAddress(UserAddressAddDTO userAddressAddDTO); CommonResult updateAddress(UserAddressUpdateDTO userAddressAddDTO); diff --git a/user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/dataobject/UserAddressDO.java b/user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/dataobject/UserAddressDO.java index 66a6eeb36..a9c6c7865 100644 --- a/user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/dataobject/UserAddressDO.java +++ b/user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/dataobject/UserAddressDO.java @@ -22,6 +22,8 @@ public class UserAddressDO extends DeletableDO { * 用户编号 */ private Integer userId; + // TODO FROM 芋艿 to 小范:需要增加下省市区; + // TODO FROM 芋艿 to 小范:想了一个增强,可以靠 API ,实现自动识别,哈哈哈;https://open.kuaidihelp.com/apitool/1019 /** * 收件区域编号 */ @@ -41,6 +43,7 @@ public class UserAddressDO extends DeletableDO { /** * 是否为默认 */ + // TODO FROM 芋艿 to 小范:是不是一起在捉摸个单词,总觉得 hasDefault 怪怪的。。 private Integer hasDefault; } diff --git a/user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/service/UserAddressServiceImpl.java b/user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/service/UserAddressServiceImpl.java index 8521a9f9e..1386064cf 100644 --- a/user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/service/UserAddressServiceImpl.java +++ b/user/user-service-impl/src/main/java/cn/iocoder/mall/user/biz/service/UserAddressServiceImpl.java @@ -39,6 +39,7 @@ public class UserAddressServiceImpl implements UserAddressService { userAddressDO.setCreateTime(new Date()); userAddressDO.setDeleted(DeletedStatusEnum.DELETED_NO.getValue()); + // TODO FROM 芋艿 to 小范:建议先更新,然后在创建 UserAddressDO // 检查是否设置为默认地址 if (UserAddressHasDefaultEnum.DEFAULT_ADDRESS_YES.getValue() == userAddressAddDTO.getHasDefault()) { UserAddressDO defaultUserAddress = userAddressMapper.selectHasDefault( @@ -106,6 +107,7 @@ public class UserAddressServiceImpl implements UserAddressService { public CommonResult removeAddress(Integer userId, Integer addressId) { UserAddressDO userAddress = userAddressMapper.selectByUserIdAndId(userId, addressId); + // TODO FROM 芋艿 to 小范:这个应该不会触发哈 if (DeletedStatusEnum.DELETED_YES.getValue().equals(userAddress.getDeleted())) { // skip return CommonResult.success(null);