From 752d4902013a5a16cf580015d0a206b057631085 Mon Sep 17 00:00:00 2001 From: "pan.zheng" Date: Tue, 9 Mar 2021 14:15:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=A5=E4=B8=BA=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=9C=B0=E5=9D=80=E8=A1=A8=E7=A4=BA=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/youlai/mall/ums/controller/app/AddressController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AddressController.java b/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AddressController.java index a40fc4502..0e782bfb5 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AddressController.java +++ b/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AddressController.java @@ -26,6 +26,7 @@ public class AddressController { private IUmsAddressService iUmsAddressService; + private final Integer ADDRESS_DEFAULTED = 1; @ApiOperation(value = "获取当前登录会员的地址列表", httpMethod = "GET") @GetMapping @@ -44,7 +45,7 @@ public class AddressController { public Result add(@RequestBody UmsAddress address) { Long userId = RequestUtils.getUserId(); address.setUserId(userId); - if (address.getDefaulted().equals(1)) { // 修改其他默认地址为非默认 + if (ADDRESS_DEFAULTED.equals(address.getDefaulted())) { // 修改其他默认地址为非默认 iUmsAddressService.update(new LambdaUpdateWrapper() .eq(UmsAddress::getUserId, userId) .eq(UmsAddress::getDefaulted, 1)