分佣:增加用户分销统计 API mock
This commit is contained in:
parent
482a84a6f1
commit
6a819da0b6
6
pom.xml
6
pom.xml
@ -16,11 +16,11 @@
|
||||
<module>yudao-module-member</module>
|
||||
<module>yudao-module-system</module>
|
||||
<module>yudao-module-infra</module>
|
||||
<!-- <module>yudao-module-pay</module>-->
|
||||
<!-- <module>yudao-module-bpm</module>-->
|
||||
<!-- <module>yudao-module-bpm</module>-->
|
||||
<!-- <module>yudao-module-report</module>-->
|
||||
<!-- <module>yudao-module-mp</module>-->
|
||||
<!-- <module>yudao-module-mall</module>-->
|
||||
<module>yudao-module-pay</module>
|
||||
<module>yudao-module-mall</module>
|
||||
<!-- 示例项目 -->
|
||||
<module>yudao-example</module>
|
||||
</modules>
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.app.combination;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils;
|
||||
import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordDetailRespVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordRespVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordSummaryRespVO;
|
||||
@ -16,8 +16,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
@ -58,7 +58,7 @@ public class AppCombinationRecordController {
|
||||
record.setId((long) i);
|
||||
record.setNickname("用户" + i);
|
||||
record.setAvatar("头像" + i);
|
||||
record.setExpireTime(new Date());
|
||||
record.setExpireTime(LocalDateTime.now());
|
||||
record.setUserSize(10);
|
||||
record.setUserCount(i);
|
||||
record.setPicUrl("https://static.iocoder.cn/mall/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg");
|
||||
@ -79,7 +79,7 @@ public class AppCombinationRecordController {
|
||||
headRecord.setId(1L);
|
||||
headRecord.setNickname("用户" + 1);
|
||||
headRecord.setAvatar("头像" + 1);
|
||||
headRecord.setExpireTime(DateUtils.addTime(Duration.ofDays(1)));
|
||||
headRecord.setExpireTime(LocalDateTimeUtils.addTime(Duration.ofDays(1)));
|
||||
headRecord.setUserSize(10);
|
||||
headRecord.setUserCount(3);
|
||||
headRecord.setStatus(1);
|
||||
@ -94,7 +94,7 @@ public class AppCombinationRecordController {
|
||||
record.setId((long) i);
|
||||
record.setNickname("用户" + i);
|
||||
record.setAvatar("头像" + i);
|
||||
record.setExpireTime(new Date());
|
||||
record.setExpireTime(LocalDateTime.now());
|
||||
record.setUserSize(10);
|
||||
record.setUserCount(i);
|
||||
record.setStatus(1);
|
||||
|
@ -0,0 +1,36 @@
|
||||
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 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 static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "用户 APP - 分销用户")
|
||||
@RestController
|
||||
@RequestMapping("/member/brokerage-user")
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class AppBrokerageUserController {
|
||||
|
||||
// TODO 芋艿:临时 mock =>
|
||||
@GetMapping("/get-summary")
|
||||
@Operation(summary = "获得个人分销统计")
|
||||
@PreAuthenticated
|
||||
public CommonResult<AppBrokerageUserSummaryRespVO> getBrokerageUserSummary() {
|
||||
AppBrokerageUserSummaryRespVO respVO = new AppBrokerageUserSummaryRespVO()
|
||||
.setYesterdayBrokeragePrice(1)
|
||||
.setBrokeragePrice(2)
|
||||
.setFrozenBrokeragePrice(3)
|
||||
.setWithdrawBrokeragePrice(4);
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.brokerage.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "用户 App - 个人分销统计 Response VO")
|
||||
@Data
|
||||
public class AppBrokerageUserSummaryRespVO {
|
||||
|
||||
@Schema(description = "昨天的佣金,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||
private Integer yesterdayBrokeragePrice;
|
||||
|
||||
@Schema(description = "提现的佣金,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Integer withdrawBrokeragePrice;
|
||||
|
||||
@Schema(description = "可用的佣金,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "2408")
|
||||
private Integer brokeragePrice;
|
||||
|
||||
@Schema(description = "冻结的佣金,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "234")
|
||||
private Integer frozenBrokeragePrice;
|
||||
|
||||
}
|
@ -39,7 +39,9 @@ public class AppMemberUserController {
|
||||
public CommonResult<AppMemberUserInfoRespVO> getUserInfo() {
|
||||
MemberUserDO user = userService.getUser(getLoginUserId());
|
||||
MemberLevelDO level = levelService.getLevel(user.getLevelId());
|
||||
return success(MemberUserConvert.INSTANCE.convert(user, level));
|
||||
return success(MemberUserConvert.INSTANCE.convert(user, level)
|
||||
.setBrokerageEnabled(true) // TODO @疯狂:这里我先写死,后面改成 db 返回;
|
||||
);
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
|
@ -29,6 +29,9 @@ public class AppMemberUserInfoRespVO {
|
||||
@Schema(description = "用户等级")
|
||||
private Level level;
|
||||
|
||||
@Schema(description = "是否成为推广员", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||
private Boolean brokerageEnabled;
|
||||
|
||||
@Schema(description = "用户 App - 会员等级")
|
||||
@Data
|
||||
public static class Level {
|
||||
|
@ -41,24 +41,24 @@
|
||||
<artifactId>yudao-spring-boot-starter-biz-error-code</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 数据报表 -->
|
||||
<!-- 数据报表。默认注释,保证编译速度 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||
<!-- <artifactId>yudao-module-report-biz</artifactId>-->
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- 工作流 -->
|
||||
<!-- 工作流。默认注释,保证编译速度 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||
<!-- <artifactId>yudao-module-bpm-biz</artifactId>-->
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- 支付服务。默认注释,保证编译速度 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||
<!-- <artifactId>yudao-module-pay-biz</artifactId>-->
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-pay-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 微信公众号模块。默认注释,保证编译速度 -->
|
||||
<!-- <dependency>-->
|
||||
@ -68,21 +68,21 @@
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- 商城相关模块。默认注释,保证编译速度 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||
<!-- <artifactId>yudao-module-promotion-biz</artifactId>-->
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||
<!-- <artifactId>yudao-module-product-biz</artifactId>-->
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||
<!-- <artifactId>yudao-module-trade-biz</artifactId>-->
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-promotion-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-product-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-trade-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- spring boot 配置所需依赖 -->
|
||||
<dependency>
|
||||
|
Loading…
Reference in New Issue
Block a user