- 添加 hasDefault

- 添加 Transactional 事务
This commit is contained in:
sin 2019-04-11 23:09:21 +08:00
parent 6a728ff410
commit 486278e1cf
2 changed files with 7 additions and 1 deletions

View File

@ -46,5 +46,10 @@ public class UserAddressAddPO implements Serializable {
@NotNull(message = "详细地址不能为空") @NotNull(message = "详细地址不能为空")
@Size(min = 10, max = 100, message = "地址在 10 ~ 100 字之间!") @Size(min = 10, max = 100, message = "地址在 10 ~ 100 字之间!")
private String address; private String address;
/**
* 收件详细地址
*/
@ApiModelProperty("默认地址")
@NotNull(message = "默认地址不能为空")
private Integer hasDefault;
} }

View File

@ -58,6 +58,7 @@ public class UserAddressServiceImpl implements UserAddressService {
} }
@Override @Override
@Transactional
public CommonResult updateAddress(UserAddressUpdateDTO userAddressAddDTO) { public CommonResult updateAddress(UserAddressUpdateDTO userAddressAddDTO) {
UserAddressDO userAddress = userAddressMapper UserAddressDO userAddress = userAddressMapper
.selectByUserIdAndId(userAddressAddDTO.getUserId(), userAddressAddDTO.getId()); .selectByUserIdAndId(userAddressAddDTO.getUserId(), userAddressAddDTO.getId());