分佣:增加用户分销记录、提现 API mock

This commit is contained in:
YunaiV 2023-09-04 21:00:03 +08:00
parent cc4c924717
commit fc56a15f76
6 changed files with 131 additions and 2 deletions

View File

@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.member.controller.app.brokerage;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.module.member.controller.app.brokerage.vo.record.AppBrokerageRecordRespVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static java.util.Arrays.asList;
@Tag(name = "用户 APP - 分销用户")
@RestController
@RequestMapping("/member/brokerage-record")
@Validated
@Slf4j
public class AppBrokerageRecordController {
// TODO 芋艿临时 mock =>
@GetMapping("/page")
@Operation(summary = "获得分销记录分页")
@PreAuthenticated
public CommonResult<PageResult<AppBrokerageRecordRespVO>> getBrokerageRecordPage() {
AppBrokerageRecordRespVO vo1 = new AppBrokerageRecordRespVO()
.setId(1L).setPrice(10).setTitle("收到钱").setCreateTime(LocalDateTime.now());
AppBrokerageRecordRespVO vo2 = new AppBrokerageRecordRespVO()
.setId(2L).setPrice(-20).setTitle("提现钱").setCreateTime(LocalDateTime.now());
return success(new PageResult<>(asList(vo1, vo2), 10L));
}
}

View File

@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.member.controller.app.brokerage;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.module.member.controller.app.brokerage.vo.AppBrokerageUserSummaryRespVO;
import cn.iocoder.yudao.module.member.controller.app.brokerage.vo.user.AppBrokerageUserSummaryRespVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;

View File

@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.member.controller.app.brokerage;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.module.member.controller.app.brokerage.vo.withdraw.AppBrokerageWithdrawRespVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static java.util.Arrays.asList;
@Tag(name = "用户 APP - 分销提现")
@RestController
@RequestMapping("/member/brokerage-withdraw")
@Validated
@Slf4j
public class AppBrokerageWithdrawController {
// TODO 芋艿临时 mock =>
@GetMapping("/page")
@Operation(summary = "获得分销提现分页")
@PreAuthenticated
public CommonResult<PageResult<AppBrokerageWithdrawRespVO>> getBrokerageWithdrawPage() {
AppBrokerageWithdrawRespVO vo1 = new AppBrokerageWithdrawRespVO()
.setId(1L).setStatus(10).setPrice(10).setStatusName("审批通过").setCreateTime(LocalDateTime.now());
AppBrokerageWithdrawRespVO vo2 = new AppBrokerageWithdrawRespVO()
.setId(2L).setStatus(0).setPrice(20).setStatusName("审批中").setCreateTime(LocalDateTime.now());
return success(new PageResult<>(asList(vo1, vo2), 10L));
}
}

View File

@ -0,0 +1,24 @@
package cn.iocoder.yudao.module.member.controller.app.brokerage.vo.record;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "用户 App - 分销记录 Response VO")
@Data
public class AppBrokerageRecordRespVO {
@Schema(description = "记录编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Long id;
@Schema(description = "分销标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "用户下单")
private String title;
@Schema(description = "分销金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000")
private Integer price;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.member.controller.app.brokerage.vo;
package cn.iocoder.yudao.module.member.controller.app.brokerage.vo.user;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

View File

@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.member.controller.app.brokerage.vo.withdraw;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "用户 App - 分销提现 Response VO")
@Data
public class AppBrokerageWithdrawRespVO {
@Schema(description = "提现编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Long id;
@Schema(description = "提现状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Integer status;
@Schema(description = "提现状态名", requiredMode = Schema.RequiredMode.REQUIRED, example = "审核中")
private String statusName;
@Schema(description = "提现金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000")
private Integer price;
@Schema(description = "提现时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}