feat(mall): 优化用户注册登录及订单管理功能
- 将DTO中的@NotBlank验证注解改为@NotNull以支持数值类型验证
- 新增我的售后服务接口并添加相应的VO类定义
- 重构用户注册逻辑,将姓名字段拆分为姓和名,并添加手机号字段
- 在用户信息返回中增加手机号显示字段
- 移除用户头像修改功能的相关代码
- 调整多个接口的限流配置,将周期从5秒改为1秒
- 删除地址修改、商品列表查询和注销接口的限流注解
- 将订单控制器移动到dependentStation包下
- 优化售后服务中心数据字典枚举,新增地址和工作时间类型
- 更新测试环境数据库连接池配置,调整最大生存时间和超时设置
- 修复密码重置DTO中字段命名不规范的问题
1 files renamed
13 files modified
| | |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | import cc.mrbird.febs.mall.service.IApiMallMemberService; |
| | | import cc.mrbird.febs.mall.vo.MallSalesServiceVo; |
| | | import cc.mrbird.febs.pay.model.WxGenerateQrCodeDto; |
| | | import cc.mrbird.febs.pay.service.IXcxPayService; |
| | | import cc.mrbird.febs.pay.util.WechatConfigure; |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @ApiOperation(value = "app注册接口", notes = "app注册接口") |
| | | @PostMapping(value = "/register") |
| | | @Limit(key = "register", period = 5, count = 1, name = "注册", prefix = "limit",limitType = LimitType.IP) |
| | | @Limit(key = "register", period = 1, count = 1, name = "注册", prefix = "limit",limitType = LimitType.IP) |
| | | public FebsResponse register(@RequestBody @Validated RegisterDto registerDto) { |
| | | return memberService.register(registerDto); |
| | | } |
| | |
| | | |
| | | @ApiOperation(value = "账号密码登录接口", notes = "账号密码登录接口") |
| | | @PostMapping(value = "/toLogin") |
| | | @Limit(key = "toLogin", period = 5, count = 1, name = "注册", prefix = "limit",limitType = LimitType.IP) |
| | | @Limit(key = "toLogin", period = 1, count = 1, name = "注册", prefix = "limit",limitType = LimitType.IP) |
| | | public FebsResponse login(@RequestBody @Validated LoginDto loginDto) { |
| | | return memberService.toLogin(loginDto); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "我的售后服务", notes = "我的售后服务") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = MallSalesServiceVo.class) |
| | | }) |
| | | @GetMapping(value = "/salesService") |
| | | public FebsResponse salesService() { |
| | | return memberService.salesService(); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @ApiOperation(value = "修改地址", notes = "修改地址") |
| | | @PostMapping(value = "/modifyAddress") |
| | | @Limit(key = "modifyAddress", period = 5, count = 1, name = "注册", prefix = "limit",limitType = LimitType.IP) |
| | | public FebsResponse modifyAddress(@RequestBody @Validated AddressInfoDto addressInfoDto) { |
| | | |
| | | return mallAddressInfoService.modifyAddress(addressInfoDto); |
| | |
| | | @ApiResponse(code = 200, message = "success", response = MallGoodsListVo.class) |
| | | }) |
| | | @PostMapping(value = "/findMallGoodsList") |
| | | @Limit(key = "findMallGoodsList", period = 5, count = 1, name = "注册", prefix = "limit",limitType = LimitType.IP) |
| | | public FebsResponse findMallGoodsList(@RequestBody MallGoodsQueryDto queryDto) { |
| | | return new FebsResponse().success().data(mallGoodsService.findMallGoodsListInPage(queryDto)); |
| | | } |
| | |
| | | |
| | | @ApiOperation(value = "注销", notes = "注销") |
| | | @PostMapping(value = "/logout") |
| | | @Limit(key = "logout", period = 5, count = 1, name = "注册", prefix = "limit",limitType = LimitType.IP) |
| | | public FebsResponse logout() { |
| | | return memberService.logout(); |
| | | } |
| | |
| | | |
| | | @ApiOperation(value = "编辑个人信息", notes = "编辑个人信息") |
| | | @PostMapping(value = "/modifyInfo") |
| | | @Limit(key = "modifyInfo", period = 5, count = 1, name = "注册", prefix = "limit",limitType = LimitType.IP) |
| | | @Limit(key = "modifyInfo", period = 1, count = 1, name = "注册", prefix = "limit",limitType = LimitType.IP) |
| | | public FebsResponse modifyInfo(@RequestBody @Validated ModifyMemberInfoDto modifyMemberInfoDto) { |
| | | return memberService.modifyMemberInfo(modifyMemberInfoDto); |
| | | } |
| | |
| | | |
| | | @ApiOperation(value = "更改密码", notes = "更改密码") |
| | | @PostMapping(value = "/forgetPwd") |
| | | @Limit(key = "forgetPwd", period = 5, count = 1, name = "注册", prefix = "limit",limitType = LimitType.IP) |
| | | @Limit(key = "forgetPwd", period = 1, count = 1, name = "注册", prefix = "limit",limitType = LimitType.IP) |
| | | public FebsResponse forgetPwd(@RequestBody @Validated ForgetPwdDto forgetPwdDto) { |
| | | return memberService.forgetPwd(forgetPwdDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的售后服务", notes = "我的售后服务") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = MallSalesServiceVo.class) |
| | | }) |
| | | @GetMapping(value = "/salesService") |
| | | public FebsResponse salesService() { |
| | | return memberService.salesService(); |
| | | } |
| | | |
| | | } |
| File was renamed from src/main/java/cc/mrbird/febs/mall/controller/ApiMallOrderController.java |
| | |
| | | package cc.mrbird.febs.mall.controller; |
| | | package cc.mrbird.febs.mall.controller.dependentStation; |
| | | |
| | | import cc.mrbird.febs.common.annotation.Limit; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | |
| | | |
| | | @ApiOperation(value = "创建订单--验证是否允许创建", notes = "创建订单--验证是否允许创建") |
| | | @PostMapping(value = "/createOrderVerify") |
| | | @Limit(key = "createOrderVerify", period = 5, count = 1, name = "注册", prefix = "limit",limitType = LimitType.IP) |
| | | @Limit(key = "createOrderVerify", period = 1, count = 1, name = "注册", prefix = "limit",limitType = LimitType.IP) |
| | | public FebsResponse createOrderVerify(@RequestBody ApiCreateOrderVerifyDto apiCreateOrderVerifyDto) { |
| | | return mallOrderInfoService.createOrderVerify(apiCreateOrderVerifyDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "创建订单", notes = "创建订单") |
| | | @PostMapping(value = "/createOrder") |
| | | @Limit(key = "createOrder", period = 5, count = 1, name = "注册", prefix = "limit",limitType = LimitType.IP) |
| | | @Limit(key = "createOrder", period = 1, count = 1, name = "注册", prefix = "limit",limitType = LimitType.IP) |
| | | public FebsResponse createOrder(@RequestBody @Validated AddOrderDto addOrderDto) { |
| | | Long orderId = mallOrderInfoService.createOrder(addOrderDto); |
| | | |
| | |
| | | |
| | | @ApiOperation(value = "取消订单", notes = "取消订单") |
| | | @PostMapping(value = "/cancelOrder/{id}") |
| | | @Limit(key = "cancelOrder", period = 5, count = 1, name = "注册", prefix = "limit",limitType = LimitType.IP) |
| | | @Limit(key = "cancelOrder", period = 1, count = 1, name = "注册", prefix = "limit",limitType = LimitType.IP) |
| | | public FebsResponse cancelOrder(@PathVariable("id") Long id) { |
| | | mallOrderInfoService.cancelOrder(id); |
| | | return new FebsResponse().success(); |
| | |
| | | public enum SalesServiceEnums { |
| | | |
| | | // 发货人 |
| | | ADDRESS("SALES_SERVICE", "ADDRESS"), |
| | | WORKINGHOURS("SALES_SERVICE", "WORKINGHOURS"), |
| | | WHATSAPP("SALES_SERVICE", "WHATSAPP"), |
| | | PHONE("SALES_SERVICE", "PHONE"), |
| | | EMAIL("SALES_SERVICE", "EMAIL"); |
| | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "AddCollectionDto", description = "添加收藏接受参数类") |
| | | public class AddCollectionDto { |
| | | |
| | | @NotBlank(message = "The product cannot be empty") |
| | | @NotNull(message = "The product cannot be empty") |
| | | @ApiModelProperty(value = "商品ID") |
| | | private Long goodsId; |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | @ApiModel(value = "AddressInfoDto", description = "地址接收参数类") |
| | | public class AddressInfoDto { |
| | | |
| | | @NotBlank(message = "{required}") |
| | | @NotNull(message = "{required}") |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | |
| | | |
| | | @NotBlank(message = "The password cannot be empty") |
| | | @ApiModelProperty(value = "新密码", example = "123456") |
| | | private String Password; |
| | | private String password; |
| | | |
| | | @NotBlank(message = "The new password cannot be empty") |
| | | @ApiModelProperty(value = "新密码", example = "123456") |
| | |
| | | @ApiModelProperty(value = "昵称", example = "123") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "头像", example = "123") |
| | | private String photo; |
| | | |
| | | } |
| | |
| | | throw new FebsException("The two passwords are inconsistent"); |
| | | } |
| | | mallMember = new MallMember(); |
| | | mallMember.setName(account); |
| | | mallMember.setName(registerDto.getLastName() + registerDto.getFirstName()); |
| | | mallMember.setPhone(registerDto.getPhoneNumber()); |
| | | mallMember.setEmail(registerDto.getAccount()); |
| | | mallMember.setPassword(SecureUtil.md5(password)); |
| | | mallMember.setAccountStatus(MallMember.ACCOUNT_STATUS_ENABLE); |
| | |
| | | MallMemberVo mallMemberVo = new MallMemberVo(); |
| | | mallMemberVo.setName(mallMember.getName()); |
| | | mallMemberVo.setEmail(mallMember.getEmail()); |
| | | mallMemberVo.setPhoneNumber(mallMember.getPhone()); |
| | | mallMemberVo.setAvatar(mallMember.getAvatar()); |
| | | return new FebsResponse().success().data(mallMemberVo); |
| | | } |
| | |
| | | MallMember mallMember = this.baseMapper.selectById(memberId); |
| | | if (StrUtil.isNotBlank(modifyMemberInfoDto.getName())) { |
| | | mallMember.setName(modifyMemberInfoDto.getName()); |
| | | } |
| | | |
| | | if (StrUtil.isNotBlank(modifyMemberInfoDto.getPhoto())) { |
| | | mallMember.setAvatar(modifyMemberInfoDto.getPhoto()); |
| | | } |
| | | |
| | | this.baseMapper.updateById(mallMember); |
| | |
| | | |
| | | @Override |
| | | public FebsResponse salesService() { |
| | | LoginUserUtil.getLoginUser().getId(); |
| | | |
| | | MallSalesServiceVo mallSalesServiceVo = new MallSalesServiceVo(); |
| | | |
| | | List<DataDictionaryCustom> dataDictionaryCustoms = dataDictionaryCustomMapper.selectDicByType( |
| | |
| | | if (SalesServiceEnums.EMAIL.getCode().equals(dataDictionaryCustom.getCode())){ |
| | | mallSalesServiceVo.setEmail(dataDictionaryCustom.getValue()); |
| | | } |
| | | if (SalesServiceEnums.WORKINGHOURS.getCode().equals(dataDictionaryCustom.getCode())){ |
| | | mallSalesServiceVo.setWorkingHours(dataDictionaryCustom.getValue()); |
| | | } |
| | | if (SalesServiceEnums.ADDRESS.getCode().equals(dataDictionaryCustom.getCode())){ |
| | | mallSalesServiceVo.setAddress(dataDictionaryCustom.getValue()); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "邮箱") |
| | | private String email; |
| | | |
| | | @ApiModelProperty(value = "手机") |
| | | private String phoneNumber; |
| | | |
| | | @ApiModelProperty(value = "头像") |
| | | private String avatar; |
| | | |
| | |
| | | @ApiModelProperty(value = "email") |
| | | private String email; |
| | | |
| | | @ApiModelProperty(value = "Address") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "Working Hours") |
| | | private String workingHours; |
| | | |
| | | } |
| | |
| | | p6spy: false |
| | | hikari: |
| | | connection-timeout: 30000 |
| | | max-lifetime: 1800000 |
| | | max-lifetime: 1200000 |
| | | max-pool-size: 15 |
| | | min-idle: 5 |
| | | connection-test-query: select 1 |
| | | pool-name: FebsHikariCP |
| | | idle-timeout: 300000 |
| | | keepaliveTime: 30000 |
| | | # 配置默认数据源 |
| | | primary: base |
| | | datasource: |
| | |
| | | # 连接池最大阻塞等待时间(使用负值表示没有限制) |
| | | max-wait: 10000 |
| | | # 连接超时时间(毫秒) |
| | | timeout: 5000 |
| | | timeout: 500000 |
| | | rabbitmq: |
| | | host: 120.27.238.55 |
| | | port: 5672 |