Commit eae8218f0dda538d7117b63ef1ec558af3db242a
1 parent
7389e4fb
分佣:增加获得分销排行分页 API mock
Showing
4 changed files
with
69 additions
and
1 deletions
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/AppBrokerageRecordController.java
| ... | ... | @@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.GetMapping; |
| 13 | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
| 14 | 14 | import org.springframework.web.bind.annotation.RestController; |
| 15 | 15 | |
| 16 | +import javax.validation.Valid; | |
| 16 | 17 | import java.time.LocalDateTime; |
| 17 | 18 | |
| 18 | 19 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| ... | ... | @@ -29,7 +30,7 @@ public class AppBrokerageRecordController { |
| 29 | 30 | @GetMapping("/page") |
| 30 | 31 | @Operation(summary = "获得分销记录分页") |
| 31 | 32 | @PreAuthenticated |
| 32 | - public CommonResult<PageResult<AppBrokerageRecordRespVO>> getBrokerageRecordPage(AppBrokerageRecordPageReqVO pageReqVO) { | |
| 33 | + public CommonResult<PageResult<AppBrokerageRecordRespVO>> getBrokerageRecordPage(@Valid AppBrokerageRecordPageReqVO pageReqVO) { | |
| 33 | 34 | AppBrokerageRecordRespVO vo1 = new AppBrokerageRecordRespVO() |
| 34 | 35 | .setId(1L).setPrice(10).setTitle("收到钱").setCreateTime(LocalDateTime.now()) |
| 35 | 36 | .setFinishTime(LocalDateTime.now()); | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/AppBrokerageUserController.java
| 1 | 1 | package cn.iocoder.yudao.module.member.controller.app.brokerage; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | 5 | import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; |
| 6 | +import cn.iocoder.yudao.module.member.controller.app.brokerage.vo.user.AppBrokerageUserRankPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.member.controller.app.brokerage.vo.user.AppBrokerageUserRankRespVO; | |
| 5 | 8 | import cn.iocoder.yudao.module.member.controller.app.brokerage.vo.user.AppBrokerageUserSummaryRespVO; |
| 6 | 9 | import io.swagger.v3.oas.annotations.Operation; |
| 7 | 10 | import io.swagger.v3.oas.annotations.tags.Tag; |
| ... | ... | @@ -12,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping; |
| 12 | 15 | import org.springframework.web.bind.annotation.RestController; |
| 13 | 16 | |
| 14 | 17 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 18 | +import static java.util.Arrays.asList; | |
| 15 | 19 | |
| 16 | 20 | @Tag(name = "用户 APP - 分销用户") |
| 17 | 21 | @RestController |
| ... | ... | @@ -33,4 +37,23 @@ public class AppBrokerageUserController { |
| 33 | 37 | return success(respVO); |
| 34 | 38 | } |
| 35 | 39 | |
| 40 | + @GetMapping("/rank-page") | |
| 41 | + @Operation(summary = "获得分销用户排行分页") | |
| 42 | + @PreAuthenticated | |
| 43 | + public CommonResult<PageResult<AppBrokerageUserRankRespVO>> getBrokerageUserRankPage(AppBrokerageUserRankPageReqVO pageReqVO) { | |
| 44 | + AppBrokerageUserRankRespVO vo1 = new AppBrokerageUserRankRespVO() | |
| 45 | + .setUserId(1L).setNickname("芋1**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg") | |
| 46 | + .setBrokerageUserCount(10); | |
| 47 | + AppBrokerageUserRankRespVO vo2 = new AppBrokerageUserRankRespVO() | |
| 48 | + .setUserId(2L).setNickname("芋2**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg") | |
| 49 | + .setBrokerageUserCount(6); | |
| 50 | + AppBrokerageUserRankRespVO vo3 = new AppBrokerageUserRankRespVO() | |
| 51 | + .setUserId(3L).setNickname("芋3**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg") | |
| 52 | + .setBrokerageUserCount(4); | |
| 53 | + AppBrokerageUserRankRespVO vo4 = new AppBrokerageUserRankRespVO() | |
| 54 | + .setUserId(3L).setNickname("芋3**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg") | |
| 55 | + .setBrokerageUserCount(4); | |
| 56 | + return success(new PageResult<>(asList(vo1, vo2, vo3, vo4), 10L)); | |
| 57 | + } | |
| 58 | + | |
| 36 | 59 | } | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/vo/user/AppBrokerageUserRankPageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.controller.app.brokerage.vo.user; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | +import lombok.Data; | |
| 6 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 7 | + | |
| 8 | +import javax.validation.constraints.NotEmpty; | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | + | |
| 11 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 12 | + | |
| 13 | +@Schema(description = "应用 App - 分销用户排行 Request VO") | |
| 14 | +@Data | |
| 15 | +public class AppBrokerageUserRankPageReqVO extends PageParam { | |
| 16 | + | |
| 17 | + @Schema(description = "开始 + 结束时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 18 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 19 | + @NotEmpty(message = "时间不能为空") | |
| 20 | + private LocalDateTime[] times; | |
| 21 | + | |
| 22 | +} | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/vo/user/AppBrokerageUserRankRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.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 AppBrokerageUserRankRespVO { | |
| 9 | + | |
| 10 | + @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") | |
| 11 | + private Long userId; | |
| 12 | + | |
| 13 | + @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "小王") | |
| 14 | + private String nickname; | |
| 15 | + | |
| 16 | + @Schema(description = "用户头像", requiredMode = Schema.RequiredMode.REQUIRED, example = "http://www.iocoder.cn/xxx.jpg") | |
| 17 | + private String avatar; | |
| 18 | + | |
| 19 | + @Schema(description = "邀请用户数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") | |
| 20 | + private Integer brokerageUserCount; | |
| 21 | + | |
| 22 | +} | ... | ... |