From eae8218f0dda538d7117b63ef1ec558af3db242a Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 5 Sep 2023 00:11:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E4=BD=A3=EF=BC=9A=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=8E=B7=E5=BE=97=E5=88=86=E9=94=80=E6=8E=92=E8=A1=8C=E5=88=86?= =?UTF-8?q?=E9=A1=B5=20API=20mock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppBrokerageRecordController.java | 3 ++- .../brokerage/AppBrokerageUserController.java | 23 +++++++++++++++++++ .../user/AppBrokerageUserRankPageReqVO.java | 22 ++++++++++++++++++ .../vo/user/AppBrokerageUserRankRespVO.java | 22 ++++++++++++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/vo/user/AppBrokerageUserRankPageReqVO.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/vo/user/AppBrokerageUserRankRespVO.java diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/AppBrokerageRecordController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/AppBrokerageRecordController.java index de2460feed..8cf4d81e8d 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/AppBrokerageRecordController.java +++ b/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; 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> getBrokerageRecordPage(AppBrokerageRecordPageReqVO pageReqVO) { + public CommonResult> getBrokerageRecordPage(@Valid AppBrokerageRecordPageReqVO pageReqVO) { AppBrokerageRecordRespVO vo1 = new AppBrokerageRecordRespVO() .setId(1L).setPrice(10).setTitle("收到钱").setCreateTime(LocalDateTime.now()) .setFinishTime(LocalDateTime.now()); diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/AppBrokerageUserController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/AppBrokerageUserController.java index 0b31c07bdc..1b5bc6184e 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/AppBrokerageUserController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/AppBrokerageUserController.java @@ -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> 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)); + } + } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/vo/user/AppBrokerageUserRankPageReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/vo/user/AppBrokerageUserRankPageReqVO.java new file mode 100644 index 0000000000..0ba1e9c75c --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/vo/user/AppBrokerageUserRankPageReqVO.java @@ -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; + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/vo/user/AppBrokerageUserRankRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/vo/user/AppBrokerageUserRankRespVO.java new file mode 100644 index 0000000000..7835f55321 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/vo/user/AppBrokerageUserRankRespVO.java @@ -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; + +}