Commit 62a4e8242b924381501ced897e098d0789d81696

Authored by YunaiV
1 parent bf92727b

分销:增加提现接口

yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/brokerage/AppBrokerageUserController.java
... ... @@ -29,6 +29,17 @@ import static java.util.Arrays.asList;
29 29 public class AppBrokerageUserController {
30 30  
31 31 // TODO 芋艿:临时 mock =>
  32 + @GetMapping("/get")
  33 + @Operation(summary = "获得个人分销信息")
  34 + @PreAuthenticated
  35 + public CommonResult<AppBrokerageUserRespVO> getBrokerageUser() {
  36 + AppBrokerageUserRespVO respVO = new AppBrokerageUserRespVO()
  37 + .setBrokeragePrice(2000)
  38 + .setFrozenBrokeragePrice(3000);
  39 + return success(respVO);
  40 + }
  41 +
  42 + // TODO 芋艿:临时 mock =>
32 43 @GetMapping("/get-summary")
33 44 @Operation(summary = "获得个人分销统计")
34 45 @PreAuthenticated
... ...
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/brokerage/AppBrokerageWithdrawController.java
... ... @@ -3,15 +3,15 @@ package cn.iocoder.yudao.module.trade.controller.app.brokerage;
3 3 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
4 4 import cn.iocoder.yudao.framework.common.pojo.PageResult;
5 5 import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
  6 +import cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.withdraw.AppBrokerageWithdrawCreateReqVO;
6 7 import cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.withdraw.AppBrokerageWithdrawRespVO;
7 8 import io.swagger.v3.oas.annotations.Operation;
8 9 import io.swagger.v3.oas.annotations.tags.Tag;
9 10 import lombok.extern.slf4j.Slf4j;
10 11 import org.springframework.validation.annotation.Validated;
11   -import org.springframework.web.bind.annotation.GetMapping;
12   -import org.springframework.web.bind.annotation.RequestMapping;
13   -import org.springframework.web.bind.annotation.RestController;
  12 +import org.springframework.web.bind.annotation.*;
14 13  
  14 +import javax.validation.Valid;
15 15 import java.time.LocalDateTime;
16 16  
17 17 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
... ... @@ -36,4 +36,12 @@ public class AppBrokerageWithdrawController {
36 36 return success(new PageResult<>(asList(vo1, vo2), 10L));
37 37 }
38 38  
  39 + // TODO 芋艿:临时 mock =>
  40 + @PostMapping("/create")
  41 + @Operation(summary = "创建分销提现")
  42 + @PreAuthenticated
  43 + public CommonResult<Long> createBrokerageWithdraw(@RequestBody @Valid AppBrokerageWithdrawCreateReqVO createReqVO) {
  44 + return success(1L);
  45 + }
  46 +
39 47 }
... ...
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/brokerage/vo/user/AppBrokerageUserRespVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.user;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +
  6 +@Schema(description = "用户 App - 分销用户信息 Response VO")
  7 +@Data
  8 +public class AppBrokerageUserRespVO {
  9 +
  10 + @Schema(description = "可用的佣金,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "2408")
  11 + private Integer brokeragePrice;
  12 +
  13 + @Schema(description = "冻结的佣金,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "234")
  14 + private Integer frozenBrokeragePrice;
  15 +
  16 +}
... ...
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/brokerage/vo/withdraw/AppBrokerageWithdrawCreateReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.withdraw;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +import org.hibernate.validator.constraints.URL;
  6 +
  7 +import javax.validation.constraints.Min;
  8 +
  9 +@Schema(description = "用户 App - 分销提现创建 Request VO")
  10 +@Data
  11 +public class AppBrokerageWithdrawCreateReqVO {
  12 +
  13 + // TODO @疯狂:参数校验逻辑,需要根据 type 进行不同的校验;感觉可以通过分组?
  14 +
  15 + @Schema(description = "提现方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
  16 + private Integer type;
  17 +
  18 + @Schema(description = "提现账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456789") // 银行卡号/微信账号/支付宝账号
  19 + private String accountNo;
  20 +
  21 + @Schema(description = "收款码的图片", example = "https://www.iocoder.cn/1.png")
  22 + @URL(message = "收款码的图片,必须是一个 URL")
  23 + private String accountQrCodeUrl;
  24 +
  25 + @Schema(description = "提现金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000")
  26 + @Min(value = 1, message = "提现金额必须大于 1")
  27 + private Integer price;
  28 +
  29 +}
... ...
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/config/AppTradeConfigController.java 0 → 100644
  1 +package cn.iocoder.yudao.module.trade.controller.app.config;
  2 +
  3 +import cn.iocoder.yudao.framework.common.pojo.CommonResult;
  4 +import cn.iocoder.yudao.module.trade.controller.app.config.vo.AppTradeConfigRespVO;
  5 +import io.swagger.v3.oas.annotations.tags.Tag;
  6 +import lombok.RequiredArgsConstructor;
  7 +import lombok.extern.slf4j.Slf4j;
  8 +import org.springframework.validation.annotation.Validated;
  9 +import org.springframework.web.bind.annotation.GetMapping;
  10 +import org.springframework.web.bind.annotation.RequestMapping;
  11 +import org.springframework.web.bind.annotation.RestController;
  12 +
  13 +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
  14 +import static java.util.Arrays.asList;
  15 +
  16 +@Tag(name = "用户 App - 交易配置")
  17 +@RestController
  18 +@RequestMapping("/trade/config")
  19 +@RequiredArgsConstructor
  20 +@Validated
  21 +@Slf4j
  22 +public class AppTradeConfigController {
  23 +
  24 + @GetMapping("/get")
  25 + public CommonResult<AppTradeConfigRespVO> getTradeConfig() {
  26 + AppTradeConfigRespVO respVO = new AppTradeConfigRespVO();
  27 + respVO.setBrokeragePosterUrls(asList(
  28 + "https://api.java.crmeb.net/crmebimage/product/2020/08/03/755bf516b1ca4b6db3bfeaa4dd5901cdh71kob20re.jpg",
  29 + "https://api.java.crmeb.net/crmebimage/maintain/2021/03/01/406d729b84ed4ec9a2171bfcf6fd0634ughzbz9kfi.jpg",
  30 + "https://api.java.crmeb.net/crmebimage/maintain/2021/03/01/efb1e4e7fe604fe1988b4213ce08cb11tdsyijtd2r.jpg"
  31 + ));
  32 + respVO.setBrokerageFrozenDays(10);
  33 + respVO.setBrokerageWithdrawMinPrice(100);
  34 + return success(respVO);
  35 + }
  36 +
  37 +}
... ...
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/config/vo/AppTradeConfigRespVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.trade.controller.app.config.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +
  6 +import java.util.List;
  7 +
  8 +@Schema(description = "用户 App - 交易配置 Response VO")
  9 +@Data
  10 +public class AppTradeConfigRespVO {
  11 +
  12 + @Schema(description = "分销海报地址数组", requiredMode = Schema.RequiredMode.REQUIRED)
  13 + private List<String> brokeragePosterUrls;
  14 +
  15 + @Schema(description = "佣金冻结时间(天)", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
  16 + private Integer brokerageFrozenDays;
  17 +
  18 + @Schema(description = "佣金提现最小金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
  19 + private Integer brokerageWithdrawMinPrice;
  20 +
  21 +}
... ...
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/vo/config/AppDeliveryConfigRespVO.java
... ... @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.trade.controller.app.delivery.vo.config;
3 3 import io.swagger.v3.oas.annotations.media.Schema;
4 4 import lombok.Data;
5 5  
6   -// TODO 芋艿:后续要实现下,配送配置
  6 +// TODO 芋艿:后续要实现下,配送配置;后续融合到 AppTradeConfigRespVO 中
7 7 @Schema(description = "用户 App - 配送配置 Response VO")
8 8 @Data
9 9 public class AppDeliveryConfigRespVO {
... ...