From 193110e4567e24353ff5dc2b9d033c9f3c421b66 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 1 Aug 2022 23:39:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=20address=20=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enums/address/UserAddressType.java | 39 ------ .../rpc/address/UserAddressFeign.java | 39 ------ .../address/dto/UserAddressCreateReqDTO.java | 48 ------- .../rpc/address/dto/UserAddressRespDTO.java | 49 ------- .../address/dto/UserAddressUpdateReqDTO.java | 60 -------- .../controller/UserAddressController.java | 54 -------- .../mysql/dataobject/address/UserAddressDO.java | 55 -------- .../manager/address/UserAddressManager.java | 86 ------------ .../service/address/UserAddressService.java | 130 ------------------ .../service/address/bo/UserAddressBO.java | 48 ------- .../service/address/bo/UserAddressCreateBO.java | 49 ------- .../service/address/bo/UserAddressUpdateBO.java | 52 ------- .../src/main/resources/sql/mall_user_schema.sql | 17 --- 13 files changed, 726 deletions(-) delete mode 100644 归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/enums/address/UserAddressType.java delete mode 100644 归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/rpc/address/UserAddressFeign.java delete mode 100644 归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/rpc/address/dto/UserAddressCreateReqDTO.java delete mode 100644 归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/rpc/address/dto/UserAddressRespDTO.java delete mode 100644 归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/rpc/address/dto/UserAddressUpdateReqDTO.java delete mode 100644 归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/controller/UserAddressController.java delete mode 100644 归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/dal/mysql/dataobject/address/UserAddressDO.java delete mode 100644 归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/manager/address/UserAddressManager.java delete mode 100644 归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/service/address/UserAddressService.java delete mode 100644 归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/service/address/bo/UserAddressBO.java delete mode 100644 归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/service/address/bo/UserAddressCreateBO.java delete mode 100644 归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/service/address/bo/UserAddressUpdateBO.java diff --git a/归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/enums/address/UserAddressType.java b/归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/enums/address/UserAddressType.java deleted file mode 100644 index a2d953d38..000000000 --- a/归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/enums/address/UserAddressType.java +++ /dev/null @@ -1,39 +0,0 @@ -package cn.iocoder.mall.userservice.enums.address; - -import cn.iocoder.common.framework.core.IntArrayValuable; - -import java.util.Arrays; - -/** - * 用户收件地址的类型枚举 - */ -public enum UserAddressType implements IntArrayValuable { - - DEFAULT(1, "默认收件地址"), - NORMAL(2, "普通收件地址"), // 即非默认收件笛之爱 - ; - - public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(UserAddressType::getType).toArray(); - - private final Integer type; - private final String desc; - - UserAddressType(Integer type, String desc) { - this.type = type; - this.desc = desc; - } - - public Integer getType() { - return type; - } - - public String getDesc() { - return desc; - } - - @Override - public int[] array() { - return ARRAYS; - } - -} diff --git a/归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/rpc/address/UserAddressFeign.java b/归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/rpc/address/UserAddressFeign.java deleted file mode 100644 index e177da6cf..000000000 --- a/归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/rpc/address/UserAddressFeign.java +++ /dev/null @@ -1,39 +0,0 @@ -package cn.iocoder.mall.userservice.rpc.address; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.userservice.rpc.address.dto.UserAddressCreateReqDTO; -import cn.iocoder.mall.userservice.rpc.address.dto.UserAddressRespDTO; -import cn.iocoder.mall.userservice.rpc.address.dto.UserAddressUpdateReqDTO; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; - -import java.util.List; - -/** -* 用户收件地址 Rpc 接口 -*/ -@FeignClient("user-service") -public interface UserAddressFeign { - - @PostMapping("/user/address/createUserAddress") - public CommonResult createUserAddress(@RequestBody UserAddressCreateReqDTO createDTO); - - @PostMapping("/user/address/updateUserAddress") - public CommonResult updateUserAddress(@RequestBody UserAddressUpdateReqDTO updateDTO); - - @GetMapping("/user/address/deleteUserAddress") - public CommonResult deleteUserAddress(@RequestParam("userAddressId") Integer userAddressId); - - @GetMapping("/user/address/getUserAddress") - public CommonResult getUserAddress(@RequestParam("userAddressId")Integer userAddressId) ; - - @GetMapping("/user/address/listUserAddressesByIds") - public CommonResult> listUserAddresses(@RequestParam("userAddressIds")List userAddressIds) ; - - @GetMapping("/user/address/listUserAddresses") - public CommonResult> listUserAddresses(@RequestParam("userId")Integer userId, @RequestParam("type")Integer type); - -} diff --git a/归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/rpc/address/dto/UserAddressCreateReqDTO.java b/归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/rpc/address/dto/UserAddressCreateReqDTO.java deleted file mode 100644 index 0698e1216..000000000 --- a/归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/rpc/address/dto/UserAddressCreateReqDTO.java +++ /dev/null @@ -1,48 +0,0 @@ -package cn.iocoder.mall.userservice.rpc.address.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** -* 用户收件地址创建 Request DTO -*/ -@Data -@Accessors(chain = true) -public class UserAddressCreateReqDTO implements Serializable { - - /** - * 用户编号 - */ - @NotNull(message = "用户编号不能为空") - private Integer userId; - /** - * 收件人名称 - */ - @NotEmpty(message = "收件人名称不能为空") - private String name; - /** - * 手机号 - */ - @NotEmpty(message = "手机号不能为空") - private String mobile; - /** - * 地区编码 - */ - @NotNull(message = "地区编码不能为空") - private Integer areaCode; - /** - * 收件详细地址 - */ - @NotEmpty(message = "收件详细地址不能为空") - private String detailAddress; - /** - * 地址类型 - */ - @NotNull(message = "地址类型不能为空") - private Integer type; - -} diff --git a/归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/rpc/address/dto/UserAddressRespDTO.java b/归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/rpc/address/dto/UserAddressRespDTO.java deleted file mode 100644 index 2668fcffb..000000000 --- a/归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/rpc/address/dto/UserAddressRespDTO.java +++ /dev/null @@ -1,49 +0,0 @@ -package cn.iocoder.mall.userservice.rpc.address.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.Date; - -/** -* 用户收件地址 Response DTO -*/ -@Data -@Accessors(chain = true) -public class UserAddressRespDTO implements Serializable { - - /** - * 收件地址编号 - */ - private Integer id; - /** - * 用户编号 - */ - private Integer userId; - /** - * 收件人名称 - */ - private String name; - /** - * 手机号 - */ - private String mobile; - /** - * 地区编码 - */ - private Integer areaCode; - /** - * 收件详细地址 - */ - private String detailAddress; - /** - * 地址类型 - */ - private Integer type; - /** - * 创建时间 - */ - private Date createTime; - -} diff --git a/归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/rpc/address/dto/UserAddressUpdateReqDTO.java b/归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/rpc/address/dto/UserAddressUpdateReqDTO.java deleted file mode 100644 index 212a4a81b..000000000 --- a/归档/user-service-project/user-service-api/src/main/java/cn/iocoder/mall/userservice/rpc/address/dto/UserAddressUpdateReqDTO.java +++ /dev/null @@ -1,60 +0,0 @@ -package cn.iocoder.mall.userservice.rpc.address.dto; - -import cn.iocoder.common.framework.validator.InEnum; -import cn.iocoder.common.framework.validator.Mobile; -import cn.iocoder.mall.userservice.enums.address.UserAddressType; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** -* 用户收件地址更新 Request DTO -*/ -@Data -@Accessors(chain = true) -public class UserAddressUpdateReqDTO implements Serializable { - - /** - * 收件地址编号 - */ - @NotNull(message = "收件地址编号不能为空") - private Integer id; - /** - * 用户编号 - * - * TODO 正在讨论 - */ - @NotNull(message = "用户编号不能为空") - private Integer userId; - /** - * 收件人名称 - */ - @NotEmpty(message = "收件人名称不能为空") - private String name; - /** - * 手机号 - */ - @NotEmpty(message = "手机号不能为空") - @Mobile - private String mobile; - /** - * 地区编码 - */ - @NotNull(message = "地区编码不能为空") - private Integer areaCode; - /** - * 收件详细地址 - */ - @NotEmpty(message = "收件详细地址不能为空") - private String detailAddress; - /** - * 地址类型 - */ - @NotNull(message = "地址类型不能为空") - @InEnum(value = UserAddressType.class, message = "地址类型必须是 {value}") - private Integer type; - -} diff --git a/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/controller/UserAddressController.java b/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/controller/UserAddressController.java deleted file mode 100644 index 5cfc918be..000000000 --- a/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/controller/UserAddressController.java +++ /dev/null @@ -1,54 +0,0 @@ -package cn.iocoder.mall.userservice.controller; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.userservice.manager.address.UserAddressManager; -import cn.iocoder.mall.userservice.rpc.address.dto.UserAddressCreateReqDTO; -import cn.iocoder.mall.userservice.rpc.address.dto.UserAddressRespDTO; -import cn.iocoder.mall.userservice.rpc.address.dto.UserAddressUpdateReqDTO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -@RestController -@RequestMapping("/user/address") -public class UserAddressController { - - @Autowired - private UserAddressManager userAddressManager; - - @PostMapping("createUserAddress") - public CommonResult createUserAddress(@RequestBody UserAddressCreateReqDTO createDTO) { - return success(userAddressManager.createUserAddress(createDTO)); - } - - @PostMapping("updateUserAddress") - public CommonResult updateUserAddress(@RequestBody UserAddressUpdateReqDTO updateDTO) { - userAddressManager.updateUserAddress(updateDTO); - return success(true); - } - - @GetMapping("deleteUserAddress") - public CommonResult deleteUserAddress(@RequestParam("userAddressId") Integer userAddressId) { - userAddressManager.deleteUserAddress(userAddressId); - return success(true); - } - - @GetMapping("getUserAddress") - public CommonResult getUserAddress(@RequestParam("userAddressId")Integer userAddressId) { - return success(userAddressManager.getUserAddress(userAddressId)); - } - - @GetMapping("listUserAddressesByIds") - public CommonResult> listUserAddresses(@RequestParam("userAddressIds")List userAddressIds) { - return success(userAddressManager.listUserAddresses(userAddressIds)); - } - - @GetMapping("listUserAddresses") - public CommonResult> listUserAddresses(@RequestParam("userId")Integer userId, @RequestParam("type")Integer type) { - return success(userAddressManager.listUserAddresses(userId, type)); - } - -} \ No newline at end of file diff --git a/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/dal/mysql/dataobject/address/UserAddressDO.java b/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/dal/mysql/dataobject/address/UserAddressDO.java deleted file mode 100644 index 47a5ece8f..000000000 --- a/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/dal/mysql/dataobject/address/UserAddressDO.java +++ /dev/null @@ -1,55 +0,0 @@ -package cn.iocoder.mall.userservice.dal.mysql.dataobject.address; - -import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; -import cn.iocoder.mall.userservice.enums.address.UserAddressType; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - * 用户收件地址 - * - * idx_userId 索引:基于 {@link #userId} 字段 - * - * @author Sin - * @time 2019-04-06 13:22 - */ -@Data -@Accessors(chain = true) -@EqualsAndHashCode(callSuper = true) -@TableName("user_address") -public class UserAddressDO extends DeletableDO { - - /** - * 编号 - */ - private Integer id; - /** - * 用户编号 - */ - private Integer userId; - /** - * 收件人名称 - */ - private String name; - /** - * 收件手机号 - */ - private String mobile; - /** - * 地区编码 - */ - private Integer areaCode; - /** - * 收件详细地址 - */ - private String detailAddress; - /** - * 地址类型,主要分为默认地址,和普通地址 - * - * 外键 {@link UserAddressType} - */ - private Integer type; - -} diff --git a/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/manager/address/UserAddressManager.java b/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/manager/address/UserAddressManager.java deleted file mode 100644 index a6602acc0..000000000 --- a/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/manager/address/UserAddressManager.java +++ /dev/null @@ -1,86 +0,0 @@ -package cn.iocoder.mall.userservice.manager.address; - -import cn.iocoder.mall.userservice.convert.address.UserAddressConvert; -import cn.iocoder.mall.userservice.rpc.address.dto.UserAddressCreateReqDTO; -import cn.iocoder.mall.userservice.rpc.address.dto.UserAddressRespDTO; -import cn.iocoder.mall.userservice.rpc.address.dto.UserAddressUpdateReqDTO; -import cn.iocoder.mall.userservice.service.address.UserAddressService; -import cn.iocoder.mall.userservice.service.address.bo.UserAddressBO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** -* 用户收件地址 Manager -*/ -@Service -public class UserAddressManager { - - @Autowired - private UserAddressService userAddressService; - - /** - * 创建用户收件地址 - * - * @param createDTO 创建用户收件地址 DTO - * @return 用户收件地址 - */ - public Integer createUserAddress(UserAddressCreateReqDTO createDTO) { - UserAddressBO userAddressBO = userAddressService.createUserAddress(UserAddressConvert.INSTANCE.convert(createDTO)); - return userAddressBO.getId(); - } - - /** - * 更新用户收件地址 - * - * @param updateDTO 更新用户收件地址 DTO - */ - public void updateUserAddress(UserAddressUpdateReqDTO updateDTO) { - userAddressService.updateUserAddress(UserAddressConvert.INSTANCE.convert(updateDTO)); - } - - /** - * 删除用户收件地址 - * - * @param userAddressId 用户收件地址编号 - */ - public void deleteUserAddress(Integer userAddressId) { - userAddressService.deleteUserAddress(userAddressId); - } - - /** - * 获得用户收件地址 - * - * @param userAddressId 用户收件地址编号 - * @return 用户收件地址 - */ - public UserAddressRespDTO getUserAddress(Integer userAddressId) { - UserAddressBO userAddressBO = userAddressService.getUserAddress(userAddressId); - return UserAddressConvert.INSTANCE.convert(userAddressBO); - } - - /** - * 获得用户收件地址列表 - * - * @param userAddressIds 用户收件地址编号列表 - * @return 用户收件地址列表 - */ - public List listUserAddresses(List userAddressIds) { - List userAddressBOs = userAddressService.listUserAddresses(userAddressIds); - return UserAddressConvert.INSTANCE.convertList02(userAddressBOs); - } - - /** - * 获取指定用户的收件地址列表 - * - * @param userId 用户编号 - * @param type 地址类型 - * @return 收件地址列表 - */ - public List listUserAddresses(Integer userId, Integer type) { - List userAddressBOs = userAddressService.listUserAddresses(userId, type); - return UserAddressConvert.INSTANCE.convertList02(userAddressBOs); - } - -} diff --git a/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/service/address/UserAddressService.java b/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/service/address/UserAddressService.java deleted file mode 100644 index a71093fa7..000000000 --- a/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/service/address/UserAddressService.java +++ /dev/null @@ -1,130 +0,0 @@ -package cn.iocoder.mall.userservice.service.address; - -import cn.iocoder.common.framework.exception.util.ServiceExceptionUtil; -import cn.iocoder.common.framework.util.CollectionUtils; -import cn.iocoder.mall.userservice.convert.address.UserAddressConvert; -import cn.iocoder.mall.userservice.dal.mysql.dataobject.address.UserAddressDO; -import cn.iocoder.mall.userservice.dal.mysql.mapper.address.UserAddressMapper; -import cn.iocoder.mall.userservice.enums.address.UserAddressType; -import cn.iocoder.mall.userservice.service.address.bo.UserAddressBO; -import cn.iocoder.mall.userservice.service.address.bo.UserAddressCreateBO; -import cn.iocoder.mall.userservice.service.address.bo.UserAddressUpdateBO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.annotation.Validated; - -import javax.validation.Valid; -import java.util.List; - -import static cn.iocoder.mall.userservice.enums.UserErrorCodeConstants.USER_ADDRESS_NOT_FOUND; - -/** -* 用户收件地址 Service -*/ -@Service -@Validated -public class UserAddressService { - - @Autowired - private UserAddressMapper userAddressMapper; - - /** - * 创建用户收件地址 - * - * @param createBO 创建用户收件地址 BO - * @return 用户收件地址 - */ - @Transactional - public UserAddressBO createUserAddress(@Valid UserAddressCreateBO createBO) { - // 如果添加的是默认收件地址,则将原默认地址修改为非默认 - if (UserAddressType.DEFAULT.getType().equals(createBO.getType())) { - List addressDOs = userAddressMapper.selectListByUserIdAndType( - createBO.getUserId(), UserAddressType.DEFAULT.getType()); - if (!CollectionUtils.isEmpty(addressDOs)) { - addressDOs.forEach(userAddressDO -> userAddressMapper.updateById(new UserAddressDO() - .setId(userAddressDO.getId()).setType(UserAddressType.DEFAULT.getType()))); - } - } - // 插入到数据库 - UserAddressDO userAddressDO = UserAddressConvert.INSTANCE.convert(createBO); - userAddressMapper.insert(userAddressDO); - // 返回 - return UserAddressConvert.INSTANCE.convert(userAddressDO); - } - - /** - * 更新用户收件地址 - * - * @param updateBO 更新用户收件地址 BO - */ - @Transactional - public void updateUserAddress(@Valid UserAddressUpdateBO updateBO) { - // 校验更新的用户收件地址是否存在 - if (userAddressMapper.selectById(updateBO.getId()) == null) { - throw ServiceExceptionUtil.exception(USER_ADDRESS_NOT_FOUND); - } - // 如果修改的是默认收件地址,则将原默认地址修改为非默认 - if (UserAddressType.DEFAULT.getType().equals(updateBO.getType())) { - List addressDOs = userAddressMapper.selectListByUserIdAndType( - updateBO.getUserId(), UserAddressType.DEFAULT.getType()); - if (!CollectionUtils.isEmpty(addressDOs)) { - addressDOs.stream().filter(userAddressDO -> userAddressDO.getId().equals(updateBO.getId())) // 过滤掉更新的收件地址 - .forEach(userAddressDO -> userAddressMapper.updateById(new UserAddressDO() - .setId(userAddressDO.getId()).setType(UserAddressType.DEFAULT.getType()))); - } - } - // 更新到数据库 - UserAddressDO updateObject = UserAddressConvert.INSTANCE.convert(updateBO); - userAddressMapper.updateById(updateObject); - } - - /** - * 删除用户收件地址 - * - * @param userAddressId 用户收件地址编号 - */ - public void deleteUserAddress(Integer userAddressId) { - // 校验删除的用户收件地址是否存在 - if (userAddressMapper.selectById(userAddressId) == null) { - throw ServiceExceptionUtil.exception(USER_ADDRESS_NOT_FOUND); - } - // 标记删除 - userAddressMapper.deleteById(userAddressId); - } - - /** - * 获得用户收件地址 - * - * @param userAddressId 用户收件地址编号 - * @return 用户收件地址 - */ - public UserAddressBO getUserAddress(Integer userAddressId) { - UserAddressDO userAddressDO = userAddressMapper.selectById(userAddressId); - return UserAddressConvert.INSTANCE.convert(userAddressDO); - } - - /** - * 获得用户收件地址列表 - * - * @param userAddressIds 用户收件地址编号列表 - * @return 用户收件地址列表 - */ - public List listUserAddresses(List userAddressIds) { - List userAddressDOs = userAddressMapper.selectBatchIds(userAddressIds); - return UserAddressConvert.INSTANCE.convertList(userAddressDOs); - } - - /** - * 获取指定用户的收件地址列表 - * - * @param userId 用户编号 - * @param type 地址类型 - * @return 收件地址列表 - */ - public List listUserAddresses(Integer userId, Integer type) { - List userAddressDOs = userAddressMapper.selectListByUserIdAndType(userId, type); - return UserAddressConvert.INSTANCE.convertList(userAddressDOs); - } - -} diff --git a/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/service/address/bo/UserAddressBO.java b/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/service/address/bo/UserAddressBO.java deleted file mode 100644 index de7451bda..000000000 --- a/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/service/address/bo/UserAddressBO.java +++ /dev/null @@ -1,48 +0,0 @@ -package cn.iocoder.mall.userservice.service.address.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.Date; - -/** -* 用户收件地址 BO -*/ -@Data -@Accessors(chain = true) -public class UserAddressBO { - - /** - * 收件地址编号 - */ - private Integer id; - /** - * 用户编号 - */ - private Integer userId; - /** - * 收件人名称 - */ - private String name; - /** - * 手机号 - */ - private String mobile; - /** - * 地区编码 - */ - private Integer areaCode; - /** - * 收件详细地址 - */ - private String detailAddress; - /** - * 地址类型 - */ - private Integer type; - /** - * 创建时间 - */ - private Date createTime; - -} diff --git a/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/service/address/bo/UserAddressCreateBO.java b/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/service/address/bo/UserAddressCreateBO.java deleted file mode 100644 index cabe00ec9..000000000 --- a/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/service/address/bo/UserAddressCreateBO.java +++ /dev/null @@ -1,49 +0,0 @@ -package cn.iocoder.mall.userservice.service.address.bo; - -import cn.iocoder.common.framework.validator.Mobile; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - -/** -* 用户收件地址创建 BO -*/ -@Data -@Accessors(chain = true) -public class UserAddressCreateBO { - - /** - * 用户编号 - */ - @NotNull(message = "用户编号不能为空") - private Integer userId; - /** - * 收件人名称 - */ - @NotEmpty(message = "收件人名称不能为空") - private String name; - /** - * 手机号 - */ - @NotEmpty(message = "手机号不能为空") - @Mobile - private String mobile; - /** - * 地区编码 - */ - @NotNull(message = "地区编码不能为空") - private Integer areaCode; - /** - * 收件详细地址 - */ - @NotEmpty(message = "收件详细地址不能为空") - private String detailAddress; - /** - * 地址类型 - */ - @NotNull(message = "地址类型不能为空") - private Integer type; - -} diff --git a/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/service/address/bo/UserAddressUpdateBO.java b/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/service/address/bo/UserAddressUpdateBO.java deleted file mode 100644 index 6321b16dc..000000000 --- a/归档/user-service-project/user-service-app/src/main/java/cn/iocoder/mall/userservice/service/address/bo/UserAddressUpdateBO.java +++ /dev/null @@ -1,52 +0,0 @@ -package cn.iocoder.mall.userservice.service.address.bo; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - -/** -* 用户收件地址更新 BO -*/ -@Data -@Accessors(chain = true) -public class UserAddressUpdateBO { - - /** - * 收件地址编号 - */ - @NotNull(message = "收件地址编号不能为空") - private Integer id; - /** - * 用户编号 - */ - @NotNull(message = "用户编号不能为空") - private Integer userId; - /** - * 收件人名称 - */ - @NotEmpty(message = "收件人名称不能为空") - private String name; - /** - * 手机号 - */ - @NotEmpty(message = "手机号不能为空") - private String mobile; - /** - * 地区编码 - */ - @NotNull(message = "地区编码不能为空") - private Integer areaCode; - /** - * 收件详细地址 - */ - @NotEmpty(message = "收件详细地址不能为空") - private String detailAddress; - /** - * 地址类型 - */ - @NotNull(message = "地址类型不能为空") - private Integer type; - -} diff --git a/归档/user-service-project/user-service-app/src/main/resources/sql/mall_user_schema.sql b/归档/user-service-project/user-service-app/src/main/resources/sql/mall_user_schema.sql index 8920b728b..6db934d98 100644 --- a/归档/user-service-project/user-service-app/src/main/resources/sql/mall_user_schema.sql +++ b/归档/user-service-project/user-service-app/src/main/resources/sql/mall_user_schema.sql @@ -38,20 +38,3 @@ CREATE TABLE `user_sms_code` ( KEY `idx_mobile` (`mobile`) USING BTREE COMMENT '手机号' ) ENGINE=InnoDB AUTO_INCREMENT=445 DEFAULT CHARSET=utf8mb4 COMMENT='手机验证码'; --- ---------------------------- --- Table structure for user_sms_code --- ---------------------------- -CREATE TABLE `user_address` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '收件地址编号', - `user_id` int(11) NOT NULL COMMENT '用户编号', - `name` varchar(10) COLLATE utf8mb4_bin NOT NULL COMMENT '收件人名称', - `mobile` varchar(20) COLLATE utf8mb4_bin NOT NULL COMMENT '手机号', - `area_code` int(11) NOT NULL COMMENT '地区编码', - `detail_address` varchar(250) COLLATE utf8mb4_bin NOT NULL COMMENT '收件详细地址', - `type` tinyint(4) NOT NULL COMMENT '地址类型', - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '删除状态', - PRIMARY KEY (`id`) USING BTREE, - KEY `idx_userId` (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用户收件地址';