分佣:增加获得分销排行分页 API mock

This commit is contained in:
YunaiV 2023-09-05 00:11:41 +08:00
parent 7389e4fb65
commit eae8218f0d
4 changed files with 69 additions and 1 deletions

View File

@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@ -29,7 +30,7 @@ public class AppBrokerageRecordController {
@GetMapping("/page")
@Operation(summary = "获得分销记录分页")
@PreAuthenticated
public CommonResult<PageResult<AppBrokerageRecordRespVO>> getBrokerageRecordPage(AppBrokerageRecordPageReqVO pageReqVO) {
public CommonResult<PageResult<AppBrokerageRecordRespVO>> getBrokerageRecordPage(@Valid AppBrokerageRecordPageReqVO pageReqVO) {
AppBrokerageRecordRespVO vo1 = new AppBrokerageRecordRespVO()
.setId(1L).setPrice(10).setTitle("收到钱").setCreateTime(LocalDateTime.now())
.setFinishTime(LocalDateTime.now());

View File

@ -1,7 +1,10 @@
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.user.AppBrokerageUserRankPageReqVO;
import cn.iocoder.yudao.module.member.controller.app.brokerage.vo.user.AppBrokerageUserRankRespVO;
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;
@ -12,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static java.util.Arrays.asList;
@Tag(name = "用户 APP - 分销用户")
@RestController
@ -33,4 +37,23 @@ public class AppBrokerageUserController {
return success(respVO);
}
@GetMapping("/rank-page")
@Operation(summary = "获得分销用户排行分页")
@PreAuthenticated
public CommonResult<PageResult<AppBrokerageUserRankRespVO>> getBrokerageUserRankPage(AppBrokerageUserRankPageReqVO pageReqVO) {
AppBrokerageUserRankRespVO vo1 = new AppBrokerageUserRankRespVO()
.setUserId(1L).setNickname("芋1**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setBrokerageUserCount(10);
AppBrokerageUserRankRespVO vo2 = new AppBrokerageUserRankRespVO()
.setUserId(2L).setNickname("芋2**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setBrokerageUserCount(6);
AppBrokerageUserRankRespVO vo3 = new AppBrokerageUserRankRespVO()
.setUserId(3L).setNickname("芋3**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setBrokerageUserCount(4);
AppBrokerageUserRankRespVO vo4 = new AppBrokerageUserRankRespVO()
.setUserId(3L).setNickname("芋3**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setBrokerageUserCount(4);
return success(new PageResult<>(asList(vo1, vo2, vo3, vo4), 10L));
}
}

View File

@ -0,0 +1,22 @@
package cn.iocoder.yudao.module.member.controller.app.brokerage.vo.user;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotEmpty;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "应用 App - 分销用户排行 Request VO")
@Data
public class AppBrokerageUserRankPageReqVO extends PageParam {
@Schema(description = "开始 + 结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@NotEmpty(message = "时间不能为空")
private LocalDateTime[] times;
}

View File

@ -0,0 +1,22 @@
package cn.iocoder.yudao.module.member.controller.app.brokerage.vo.user;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "用户 App - 分销排行用户 Response VO")
@Data
public class AppBrokerageUserRankRespVO {
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Long userId;
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "小王")
private String nickname;
@Schema(description = "用户头像", requiredMode = Schema.RequiredMode.REQUIRED, example = "http://www.iocoder.cn/xxx.jpg")
private String avatar;
@Schema(description = "邀请用户数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Integer brokerageUserCount;
}