mirror of
https://gitee.com/youlaitech/youlai-mall.git
synced 2025-01-03 17:42:20 +08:00
修复以为默认地址表示为空导致的异常
This commit is contained in:
parent
b01367fb2a
commit
752d490201
@ -26,6 +26,7 @@ public class AddressController {
|
|||||||
|
|
||||||
private IUmsAddressService iUmsAddressService;
|
private IUmsAddressService iUmsAddressService;
|
||||||
|
|
||||||
|
private final Integer ADDRESS_DEFAULTED = 1;
|
||||||
|
|
||||||
@ApiOperation(value = "获取当前登录会员的地址列表", httpMethod = "GET")
|
@ApiOperation(value = "获取当前登录会员的地址列表", httpMethod = "GET")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@ -44,7 +45,7 @@ public class AddressController {
|
|||||||
public Result add(@RequestBody UmsAddress address) {
|
public Result add(@RequestBody UmsAddress address) {
|
||||||
Long userId = RequestUtils.getUserId();
|
Long userId = RequestUtils.getUserId();
|
||||||
address.setUserId(userId);
|
address.setUserId(userId);
|
||||||
if (address.getDefaulted().equals(1)) { // 修改其他默认地址为非默认
|
if (ADDRESS_DEFAULTED.equals(address.getDefaulted())) { // 修改其他默认地址为非默认
|
||||||
iUmsAddressService.update(new LambdaUpdateWrapper<UmsAddress>()
|
iUmsAddressService.update(new LambdaUpdateWrapper<UmsAddress>()
|
||||||
.eq(UmsAddress::getUserId, userId)
|
.eq(UmsAddress::getUserId, userId)
|
||||||
.eq(UmsAddress::getDefaulted, 1)
|
.eq(UmsAddress::getDefaulted, 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user