- 调通 用户商品地址
This commit is contained in:
@@ -27,6 +27,9 @@ public interface UserAddressConvert {
|
||||
@Mappings({})
|
||||
UserAddressDO convert(UserAddressUpdateDTO userAddressUpdateDTO);
|
||||
|
||||
@Mappings({})
|
||||
UserAddressBO convert(UserAddressDO userAddressDO);
|
||||
|
||||
@Mappings({})
|
||||
List<UserAddressBO> convertUserAddressBOList(List<UserAddressDO> userAddressDOList);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class UserAddressServiceImpl implements UserAddressService {
|
||||
.selectByUserIdAndId(userAddressAddDTO.getUserId(), userAddressAddDTO.getId());
|
||||
|
||||
if (DeletedStatusEnum.DELETED_YES.getValue().equals(userAddress.getDeleted())) {
|
||||
return CommonResult.success(UserErrorCodeEnum.USER_ADDRESS_IS_DELETED.getCode());
|
||||
return ServiceExceptionUtil.error(UserErrorCodeEnum.USER_ADDRESS_IS_DELETED.getCode());
|
||||
}
|
||||
|
||||
if (userAddress == null) {
|
||||
@@ -89,4 +89,16 @@ public class UserAddressServiceImpl implements UserAddressService {
|
||||
|
||||
return CommonResult.success(userAddressBOList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<UserAddressBO> getAddress(Integer userId, Integer id) {
|
||||
UserAddressDO userAddress = userAddressMapper.selectByUserIdAndId(userId, id);
|
||||
|
||||
if (DeletedStatusEnum.DELETED_YES.getValue().equals(userAddress.getDeleted())) {
|
||||
return ServiceExceptionUtil.error(UserErrorCodeEnum.USER_ADDRESS_IS_DELETED.getCode());
|
||||
}
|
||||
|
||||
UserAddressBO userAddressBO = UserAddressConvert.INSTANCE.convert(userAddress);
|
||||
return CommonResult.success(userAddressBO);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
|
||||
<insert id="insert" parameterType="UserAddressDO" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO user_address (
|
||||
user_id, area_no, `name`, mobile, address
|
||||
user_id, area_no, `name`, mobile, address,
|
||||
create_time, update_time, deleted
|
||||
) VALUES (
|
||||
#{userId}, #{areaNo}, #{name}, #{mobile}, #{address},
|
||||
#{createTime}, #{updateTime}, #{deleted}
|
||||
|
||||
Reference in New Issue
Block a user