Merge remote-tracking branch 'origin/feature/mall_product' into feature/mall_product

This commit is contained in:
jason 2023-09-06 08:50:33 +08:00
commit 4a0fa2a3a4
14 changed files with 223 additions and 103 deletions

View File

@ -1,5 +1,9 @@
package cn.iocoder.yudao.framework.common.pojo; package cn.iocoder.yudao.framework.common.pojo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable; import java.io.Serializable;
/** /**
@ -7,6 +11,9 @@ import java.io.Serializable;
* *
* 类名加了 ing 的原因是避免和 ES SortField 重名 * 类名加了 ing 的原因是避免和 ES SortField 重名
*/ */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SortingField implements Serializable { public class SortingField implements Serializable {
/** /**
@ -27,30 +34,4 @@ public class SortingField implements Serializable {
*/ */
private String order; private String order;
// 空构造方法解决反序列化
public SortingField() {
}
public SortingField(String field, String order) {
this.field = field;
this.order = order;
}
public String getField() {
return field;
}
public SortingField setField(String field) {
this.field = field;
return this;
}
public String getOrder() {
return order;
}
public SortingField setOrder(String order) {
this.order = order;
return this;
}
} }

View File

@ -1,10 +1,10 @@
package cn.iocoder.yudao.module.member.controller.app.brokerage; package cn.iocoder.yudao.module.trade.controller.app.brokerage;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.module.member.controller.app.brokerage.vo.record.AppBrokerageRecordPageReqVO; import cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.record.AppBrokerageRecordPageReqVO;
import cn.iocoder.yudao.module.member.controller.app.brokerage.vo.record.AppBrokerageRecordRespVO; import cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.record.AppBrokerageRecordRespVO;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -21,7 +21,7 @@ import static java.util.Arrays.asList;
@Tag(name = "用户 APP - 分销用户") @Tag(name = "用户 APP - 分销用户")
@RestController @RestController
@RequestMapping("/member/brokerage-record") @RequestMapping("/trade/brokerage-record")
@Validated @Validated
@Slf4j @Slf4j
public class AppBrokerageRecordController { public class AppBrokerageRecordController {

View File

@ -0,0 +1,112 @@
package cn.iocoder.yudao.module.trade.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.trade.controller.app.brokerage.vo.user.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.format.annotation.DateTimeFormat;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
import static java.util.Arrays.asList;
@Tag(name = "用户 APP - 分销用户")
@RestController
@RequestMapping("/trade/brokerage-user")
@Validated
@Slf4j
public class AppBrokerageUserController {
// TODO 芋艿临时 mock =>
@GetMapping("/get-summary")
@Operation(summary = "获得个人分销统计")
@PreAuthenticated
public CommonResult<AppBrokerageUserMySummaryRespVO> getBrokerageUserSummary() {
AppBrokerageUserMySummaryRespVO respVO = new AppBrokerageUserMySummaryRespVO()
.setYesterdayBrokeragePrice(1)
.setBrokeragePrice(2)
.setFrozenBrokeragePrice(3)
.setWithdrawBrokeragePrice(4)
.setFirstBrokerageUserCount(166)
.setSecondBrokerageUserCount(233);
return success(respVO);
}
// TODO 芋艿临时 mock =>
@GetMapping("/rank-page-by-user-count")
@Operation(summary = "获得分销用户排行分页(基于用户量)")
@PreAuthenticated
public CommonResult<PageResult<AppBrokerageUserRankByUserCountRespVO>> getBrokerageUserRankPageByUserCount(AppBrokerageUserRankPageReqVO pageReqVO) {
AppBrokerageUserRankByUserCountRespVO vo1 = new AppBrokerageUserRankByUserCountRespVO()
.setId(1L).setNickname("芋1**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setBrokerageUserCount(10);
AppBrokerageUserRankByUserCountRespVO vo2 = new AppBrokerageUserRankByUserCountRespVO()
.setId(2L).setNickname("芋2**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setBrokerageUserCount(6);
AppBrokerageUserRankByUserCountRespVO vo3 = new AppBrokerageUserRankByUserCountRespVO()
.setId(3L).setNickname("芋3**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setBrokerageUserCount(4);
AppBrokerageUserRankByUserCountRespVO vo4 = new AppBrokerageUserRankByUserCountRespVO()
.setId(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));
}
// TODO 芋艿临时 mock =>
@GetMapping("/rank-page-by-price")
@Operation(summary = "获得分销用户排行分页(基于佣金)")
@PreAuthenticated
public CommonResult<PageResult<AppBrokerageUserRankByPriceRespVO>> getBrokerageUserChildSummaryPageByPrice(AppBrokerageUserRankPageReqVO pageReqVO) {
AppBrokerageUserRankByPriceRespVO vo1 = new AppBrokerageUserRankByPriceRespVO()
.setId(1L).setNickname("芋1**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setBrokeragePrice(10);
AppBrokerageUserRankByPriceRespVO vo2 = new AppBrokerageUserRankByPriceRespVO()
.setId(2L).setNickname("芋2**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setBrokeragePrice(6);
AppBrokerageUserRankByPriceRespVO vo3 = new AppBrokerageUserRankByPriceRespVO()
.setId(3L).setNickname("芋3**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setBrokeragePrice(4);
AppBrokerageUserRankByPriceRespVO vo4 = new AppBrokerageUserRankByPriceRespVO()
.setId(3L).setNickname("芋3**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setBrokeragePrice(4);
return success(new PageResult<>(asList(vo1, vo2, vo3, vo4), 10L));
}
// TODO 芋艿临时 mock =>
@GetMapping("/child-summary-page")
@Operation(summary = "获得下级分销统计分页")
@PreAuthenticated
public CommonResult<PageResult<AppBrokerageUserChildSummaryRespVO>> getBrokerageUserChildSummaryPage(
AppBrokerageUserChildSummaryPageReqVO pageReqVO) {
AppBrokerageUserChildSummaryRespVO vo1 = new AppBrokerageUserChildSummaryRespVO()
.setId(1L).setNickname("芋1**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setBrokeragePrice(10).setBrokeragePrice(20).setBrokerageOrderCount(30)
.setBrokerageTime(LocalDateTime.now());
AppBrokerageUserChildSummaryRespVO vo2 = new AppBrokerageUserChildSummaryRespVO()
.setId(1L).setNickname("芋2**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setBrokeragePrice(20).setBrokeragePrice(30).setBrokerageOrderCount(40)
.setBrokerageTime(LocalDateTime.now());
return success(new PageResult<>(asList(vo1, vo2), 10L));
}
// TODO 芋艿临时 mock =>
@GetMapping("/get-rank-by-price")
@Operation(summary = "获得分销用户排行(基于佣金)")
@Parameter(name = "times", description = "时间段", required = true)
public CommonResult<Integer> getBrokerageUserRankByPrice(
@RequestParam("times") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) LocalDateTime[] times) {
return success(1);
}
}

View File

@ -1,9 +1,9 @@
package cn.iocoder.yudao.module.member.controller.app.brokerage; package cn.iocoder.yudao.module.trade.controller.app.brokerage;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.module.member.controller.app.brokerage.vo.withdraw.AppBrokerageWithdrawRespVO; import cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.withdraw.AppBrokerageWithdrawRespVO;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -19,7 +19,7 @@ import static java.util.Arrays.asList;
@Tag(name = "用户 APP - 分销提现") @Tag(name = "用户 APP - 分销提现")
@RestController @RestController
@RequestMapping("/member/brokerage-withdraw") @RequestMapping("/trade/brokerage-withdraw")
@Validated @Validated
@Slf4j @Slf4j
public class AppBrokerageWithdrawController { public class AppBrokerageWithdrawController {

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.member.controller.app.brokerage.vo.record; package cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.record;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.member.controller.app.brokerage.vo.record; package cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.record;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;

View File

@ -0,0 +1,25 @@
package cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.user;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.SortingField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "用户 App - 下级分销统计分页 Request VO")
@Data
public class AppBrokerageUserChildSummaryPageReqVO extends PageParam {
public static final String SORT_FIELD_USER_COUNT = "userCount";
public static final String SORT_FIELD_ORDER_COUNT = "orderCount";
public static final String SORT_FIELD_PRICE = "price";
@Schema(description = "用户昵称", example = "") // 模糊匹配
private String nickname;
@Schema(description = "排序字段", example = "userCount")
private SortingField sortingField;
@Schema(description = "下级的级别", example = "1") // 1 - 直接下级2 - 间接下级
private Integer level;
}

View File

@ -0,0 +1,33 @@
package cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.user;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "用户 App - 下级分销统计 Response VO")
@Data
public class AppBrokerageUserChildSummaryRespVO {
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Long id;
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "小王")
private String nickname;
@Schema(description = "用户头像", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/xxx.jpg")
private String avatar;
@Schema(description = "佣金金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Integer brokeragePrice;
@Schema(description = "分销订单数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "20")
private Integer brokerageOrderCount;
@Schema(description = "分销用户数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "30")
private Integer brokerageUserCount;
@Schema(description = "成为分销员时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime brokerageTime;
}

View File

@ -1,11 +1,11 @@
package cn.iocoder.yudao.module.member.controller.app.brokerage.vo.user; package cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.user;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
@Schema(description = "用户 App - 个人分销统计 Response VO") @Schema(description = "用户 App - 个人分销统计 Response VO")
@Data @Data
public class AppBrokerageUserSummaryRespVO { public class AppBrokerageUserMySummaryRespVO {
@Schema(description = "昨天的佣金,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") @Schema(description = "昨天的佣金,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Integer yesterdayBrokeragePrice; private Integer yesterdayBrokeragePrice;
@ -19,4 +19,10 @@ public class AppBrokerageUserSummaryRespVO {
@Schema(description = "冻结的佣金,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "234") @Schema(description = "冻结的佣金,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "234")
private Integer frozenBrokeragePrice; private Integer frozenBrokeragePrice;
@Schema(description = "分销用户数量(一级)", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Integer firstBrokerageUserCount;
@Schema(description = "分销用户数量(二级)", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Integer secondBrokerageUserCount;
} }

View File

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

View File

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

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.member.controller.app.brokerage.vo.user; package cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.user;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.member.controller.app.brokerage.vo.withdraw; package cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.withdraw;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;

View File

@ -1,59 +0,0 @@
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;
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;
import static java.util.Arrays.asList;
@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);
}
@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));
}
}