Commit 6a819da0b6cdd4b9f3eb8c67c519e2a6eb8498c6
1 parent
482a84a6
分佣:增加用户分销统计 API mock
Showing
7 changed files
with
94 additions
and
31 deletions
pom.xml
| @@ -16,11 +16,11 @@ | @@ -16,11 +16,11 @@ | ||
| 16 | <module>yudao-module-member</module> | 16 | <module>yudao-module-member</module> |
| 17 | <module>yudao-module-system</module> | 17 | <module>yudao-module-system</module> |
| 18 | <module>yudao-module-infra</module> | 18 | <module>yudao-module-infra</module> |
| 19 | -<!-- <module>yudao-module-pay</module>--> | ||
| 20 | -<!-- <module>yudao-module-bpm</module>--> | 19 | + <!-- <module>yudao-module-bpm</module>--> |
| 21 | <!-- <module>yudao-module-report</module>--> | 20 | <!-- <module>yudao-module-report</module>--> |
| 22 | <!-- <module>yudao-module-mp</module>--> | 21 | <!-- <module>yudao-module-mp</module>--> |
| 23 | -<!-- <module>yudao-module-mall</module>--> | 22 | + <module>yudao-module-pay</module> |
| 23 | + <module>yudao-module-mall</module> | ||
| 24 | <!-- 示例项目 --> | 24 | <!-- 示例项目 --> |
| 25 | <module>yudao-example</module> | 25 | <module>yudao-example</module> |
| 26 | </modules> | 26 | </modules> |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationRecordController.java
| 1 | package cn.iocoder.yudao.module.promotion.controller.app.combination; | 1 | package cn.iocoder.yudao.module.promotion.controller.app.combination; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | -import cn.iocoder.yudao.framework.common.util.date.DateUtils; | 4 | +import cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils; |
| 5 | import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordDetailRespVO; | 5 | import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordDetailRespVO; |
| 6 | import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordRespVO; | 6 | import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordRespVO; |
| 7 | import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordSummaryRespVO; | 7 | import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordSummaryRespVO; |
| @@ -16,8 +16,8 @@ import org.springframework.web.bind.annotation.RestController; | @@ -16,8 +16,8 @@ import org.springframework.web.bind.annotation.RestController; | ||
| 16 | 16 | ||
| 17 | import javax.validation.constraints.Max; | 17 | import javax.validation.constraints.Max; |
| 18 | import java.time.Duration; | 18 | import java.time.Duration; |
| 19 | +import java.time.LocalDateTime; | ||
| 19 | import java.util.ArrayList; | 20 | import java.util.ArrayList; |
| 20 | -import java.util.Date; | ||
| 21 | import java.util.List; | 21 | import java.util.List; |
| 22 | 22 | ||
| 23 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 23 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| @@ -58,7 +58,7 @@ public class AppCombinationRecordController { | @@ -58,7 +58,7 @@ public class AppCombinationRecordController { | ||
| 58 | record.setId((long) i); | 58 | record.setId((long) i); |
| 59 | record.setNickname("用户" + i); | 59 | record.setNickname("用户" + i); |
| 60 | record.setAvatar("头像" + i); | 60 | record.setAvatar("头像" + i); |
| 61 | - record.setExpireTime(new Date()); | 61 | + record.setExpireTime(LocalDateTime.now()); |
| 62 | record.setUserSize(10); | 62 | record.setUserSize(10); |
| 63 | record.setUserCount(i); | 63 | record.setUserCount(i); |
| 64 | record.setPicUrl("https://static.iocoder.cn/mall/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); | 64 | record.setPicUrl("https://static.iocoder.cn/mall/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); |
| @@ -79,7 +79,7 @@ public class AppCombinationRecordController { | @@ -79,7 +79,7 @@ public class AppCombinationRecordController { | ||
| 79 | headRecord.setId(1L); | 79 | headRecord.setId(1L); |
| 80 | headRecord.setNickname("用户" + 1); | 80 | headRecord.setNickname("用户" + 1); |
| 81 | headRecord.setAvatar("头像" + 1); | 81 | headRecord.setAvatar("头像" + 1); |
| 82 | - headRecord.setExpireTime(DateUtils.addTime(Duration.ofDays(1))); | 82 | + headRecord.setExpireTime(LocalDateTimeUtils.addTime(Duration.ofDays(1))); |
| 83 | headRecord.setUserSize(10); | 83 | headRecord.setUserSize(10); |
| 84 | headRecord.setUserCount(3); | 84 | headRecord.setUserCount(3); |
| 85 | headRecord.setStatus(1); | 85 | headRecord.setStatus(1); |
| @@ -94,7 +94,7 @@ public class AppCombinationRecordController { | @@ -94,7 +94,7 @@ public class AppCombinationRecordController { | ||
| 94 | record.setId((long) i); | 94 | record.setId((long) i); |
| 95 | record.setNickname("用户" + i); | 95 | record.setNickname("用户" + i); |
| 96 | record.setAvatar("头像" + i); | 96 | record.setAvatar("头像" + i); |
| 97 | - record.setExpireTime(new Date()); | 97 | + record.setExpireTime(LocalDateTime.now()); |
| 98 | record.setUserSize(10); | 98 | record.setUserSize(10); |
| 99 | record.setUserCount(i); | 99 | record.setUserCount(i); |
| 100 | record.setStatus(1); | 100 | record.setStatus(1); |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/AppBrokerageUserController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.controller.app.brokerage; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 4 | +import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | ||
| 5 | +import cn.iocoder.yudao.module.member.controller.app.brokerage.vo.AppBrokerageUserSummaryRespVO; | ||
| 6 | +import io.swagger.v3.oas.annotations.Operation; | ||
| 7 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 8 | +import lombok.extern.slf4j.Slf4j; | ||
| 9 | +import org.springframework.validation.annotation.Validated; | ||
| 10 | +import org.springframework.web.bind.annotation.GetMapping; | ||
| 11 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 12 | +import org.springframework.web.bind.annotation.RestController; | ||
| 13 | + | ||
| 14 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 15 | + | ||
| 16 | +@Tag(name = "用户 APP - 分销用户") | ||
| 17 | +@RestController | ||
| 18 | +@RequestMapping("/member/brokerage-user") | ||
| 19 | +@Validated | ||
| 20 | +@Slf4j | ||
| 21 | +public class AppBrokerageUserController { | ||
| 22 | + | ||
| 23 | + // TODO 芋艿:临时 mock => | ||
| 24 | + @GetMapping("/get-summary") | ||
| 25 | + @Operation(summary = "获得个人分销统计") | ||
| 26 | + @PreAuthenticated | ||
| 27 | + public CommonResult<AppBrokerageUserSummaryRespVO> getBrokerageUserSummary() { | ||
| 28 | + AppBrokerageUserSummaryRespVO respVO = new AppBrokerageUserSummaryRespVO() | ||
| 29 | + .setYesterdayBrokeragePrice(1) | ||
| 30 | + .setBrokeragePrice(2) | ||
| 31 | + .setFrozenBrokeragePrice(3) | ||
| 32 | + .setWithdrawBrokeragePrice(4); | ||
| 33 | + return success(respVO); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | +} |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/brokerage/vo/AppBrokerageUserSummaryRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.controller.app.brokerage.vo; | ||
| 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 AppBrokerageUserSummaryRespVO { | ||
| 9 | + | ||
| 10 | + @Schema(description = "昨天的佣金,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") | ||
| 11 | + private Integer yesterdayBrokeragePrice; | ||
| 12 | + | ||
| 13 | + @Schema(description = "提现的佣金,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | ||
| 14 | + private Integer withdrawBrokeragePrice; | ||
| 15 | + | ||
| 16 | + @Schema(description = "可用的佣金,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "2408") | ||
| 17 | + private Integer brokeragePrice; | ||
| 18 | + | ||
| 19 | + @Schema(description = "冻结的佣金,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "234") | ||
| 20 | + private Integer frozenBrokeragePrice; | ||
| 21 | + | ||
| 22 | +} |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/AppMemberUserController.java
| @@ -39,7 +39,9 @@ public class AppMemberUserController { | @@ -39,7 +39,9 @@ public class AppMemberUserController { | ||
| 39 | public CommonResult<AppMemberUserInfoRespVO> getUserInfo() { | 39 | public CommonResult<AppMemberUserInfoRespVO> getUserInfo() { |
| 40 | MemberUserDO user = userService.getUser(getLoginUserId()); | 40 | MemberUserDO user = userService.getUser(getLoginUserId()); |
| 41 | MemberLevelDO level = levelService.getLevel(user.getLevelId()); | 41 | MemberLevelDO level = levelService.getLevel(user.getLevelId()); |
| 42 | - return success(MemberUserConvert.INSTANCE.convert(user, level)); | 42 | + return success(MemberUserConvert.INSTANCE.convert(user, level) |
| 43 | + .setBrokerageEnabled(true) // TODO @疯狂:这里我先写死,后面改成 db 返回; | ||
| 44 | + ); | ||
| 43 | } | 45 | } |
| 44 | 46 | ||
| 45 | @PutMapping("/update") | 47 | @PutMapping("/update") |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppMemberUserInfoRespVO.java
| @@ -29,6 +29,9 @@ public class AppMemberUserInfoRespVO { | @@ -29,6 +29,9 @@ public class AppMemberUserInfoRespVO { | ||
| 29 | @Schema(description = "用户等级") | 29 | @Schema(description = "用户等级") |
| 30 | private Level level; | 30 | private Level level; |
| 31 | 31 | ||
| 32 | + @Schema(description = "是否成为推广员", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | ||
| 33 | + private Boolean brokerageEnabled; | ||
| 34 | + | ||
| 32 | @Schema(description = "用户 App - 会员等级") | 35 | @Schema(description = "用户 App - 会员等级") |
| 33 | @Data | 36 | @Data |
| 34 | public static class Level { | 37 | public static class Level { |
yudao-server/pom.xml
| @@ -41,24 +41,24 @@ | @@ -41,24 +41,24 @@ | ||
| 41 | <artifactId>yudao-spring-boot-starter-biz-error-code</artifactId> | 41 | <artifactId>yudao-spring-boot-starter-biz-error-code</artifactId> |
| 42 | </dependency> | 42 | </dependency> |
| 43 | 43 | ||
| 44 | - <!-- 数据报表 --> | 44 | + <!-- 数据报表。默认注释,保证编译速度 --> |
| 45 | <!-- <dependency>--> | 45 | <!-- <dependency>--> |
| 46 | <!-- <groupId>cn.iocoder.boot</groupId>--> | 46 | <!-- <groupId>cn.iocoder.boot</groupId>--> |
| 47 | <!-- <artifactId>yudao-module-report-biz</artifactId>--> | 47 | <!-- <artifactId>yudao-module-report-biz</artifactId>--> |
| 48 | <!-- <version>${revision}</version>--> | 48 | <!-- <version>${revision}</version>--> |
| 49 | <!-- </dependency>--> | 49 | <!-- </dependency>--> |
| 50 | - <!-- 工作流 --> | 50 | + <!-- 工作流。默认注释,保证编译速度 --> |
| 51 | <!-- <dependency>--> | 51 | <!-- <dependency>--> |
| 52 | <!-- <groupId>cn.iocoder.boot</groupId>--> | 52 | <!-- <groupId>cn.iocoder.boot</groupId>--> |
| 53 | <!-- <artifactId>yudao-module-bpm-biz</artifactId>--> | 53 | <!-- <artifactId>yudao-module-bpm-biz</artifactId>--> |
| 54 | <!-- <version>${revision}</version>--> | 54 | <!-- <version>${revision}</version>--> |
| 55 | <!-- </dependency>--> | 55 | <!-- </dependency>--> |
| 56 | <!-- 支付服务。默认注释,保证编译速度 --> | 56 | <!-- 支付服务。默认注释,保证编译速度 --> |
| 57 | -<!-- <dependency>--> | ||
| 58 | -<!-- <groupId>cn.iocoder.boot</groupId>--> | ||
| 59 | -<!-- <artifactId>yudao-module-pay-biz</artifactId>--> | ||
| 60 | -<!-- <version>${revision}</version>--> | ||
| 61 | -<!-- </dependency>--> | 57 | + <dependency> |
| 58 | + <groupId>cn.iocoder.boot</groupId> | ||
| 59 | + <artifactId>yudao-module-pay-biz</artifactId> | ||
| 60 | + <version>${revision}</version> | ||
| 61 | + </dependency> | ||
| 62 | 62 | ||
| 63 | <!-- 微信公众号模块。默认注释,保证编译速度 --> | 63 | <!-- 微信公众号模块。默认注释,保证编译速度 --> |
| 64 | <!-- <dependency>--> | 64 | <!-- <dependency>--> |
| @@ -68,21 +68,21 @@ | @@ -68,21 +68,21 @@ | ||
| 68 | <!-- </dependency>--> | 68 | <!-- </dependency>--> |
| 69 | 69 | ||
| 70 | <!-- 商城相关模块。默认注释,保证编译速度 --> | 70 | <!-- 商城相关模块。默认注释,保证编译速度 --> |
| 71 | -<!-- <dependency>--> | ||
| 72 | -<!-- <groupId>cn.iocoder.boot</groupId>--> | ||
| 73 | -<!-- <artifactId>yudao-module-promotion-biz</artifactId>--> | ||
| 74 | -<!-- <version>${revision}</version>--> | ||
| 75 | -<!-- </dependency>--> | ||
| 76 | -<!-- <dependency>--> | ||
| 77 | -<!-- <groupId>cn.iocoder.boot</groupId>--> | ||
| 78 | -<!-- <artifactId>yudao-module-product-biz</artifactId>--> | ||
| 79 | -<!-- <version>${revision}</version>--> | ||
| 80 | -<!-- </dependency>--> | ||
| 81 | -<!-- <dependency>--> | ||
| 82 | -<!-- <groupId>cn.iocoder.boot</groupId>--> | ||
| 83 | -<!-- <artifactId>yudao-module-trade-biz</artifactId>--> | ||
| 84 | -<!-- <version>${revision}</version>--> | ||
| 85 | -<!-- </dependency>--> | 71 | + <dependency> |
| 72 | + <groupId>cn.iocoder.boot</groupId> | ||
| 73 | + <artifactId>yudao-module-promotion-biz</artifactId> | ||
| 74 | + <version>${revision}</version> | ||
| 75 | + </dependency> | ||
| 76 | + <dependency> | ||
| 77 | + <groupId>cn.iocoder.boot</groupId> | ||
| 78 | + <artifactId>yudao-module-product-biz</artifactId> | ||
| 79 | + <version>${revision}</version> | ||
| 80 | + </dependency> | ||
| 81 | + <dependency> | ||
| 82 | + <groupId>cn.iocoder.boot</groupId> | ||
| 83 | + <artifactId>yudao-module-trade-biz</artifactId> | ||
| 84 | + <version>${revision}</version> | ||
| 85 | + </dependency> | ||
| 86 | 86 | ||
| 87 | <!-- spring boot 配置所需依赖 --> | 87 | <!-- spring boot 配置所需依赖 --> |
| 88 | <dependency> | 88 | <dependency> |