Commit 4265441e1daec669527b89a02e4e1a4850b4560c
1 parent
a47d744f
分销:增加商品的分佣金额计算 api mock
Showing
2 changed files
with
31 additions
and
0 deletions
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/brokerage/AppBrokerageRecordController.java
| @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.trade.controller.app.brokerage; | @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.trade.controller.app.brokerage; | ||
| 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.pojo.PageResult; | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; | 5 | import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; |
| 6 | +import cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.record.AppBrokerageProductPriceRespVO; | ||
| 6 | import cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.record.AppBrokerageRecordPageReqVO; | 7 | import cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.record.AppBrokerageRecordPageReqVO; |
| 7 | import cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.record.AppBrokerageRecordRespVO; | 8 | import cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.record.AppBrokerageRecordRespVO; |
| 8 | import io.swagger.v3.oas.annotations.Operation; | 9 | import io.swagger.v3.oas.annotations.Operation; |
| @@ -11,6 +12,7 @@ import lombok.extern.slf4j.Slf4j; | @@ -11,6 +12,7 @@ import lombok.extern.slf4j.Slf4j; | ||
| 11 | import org.springframework.validation.annotation.Validated; | 12 | import org.springframework.validation.annotation.Validated; |
| 12 | import org.springframework.web.bind.annotation.GetMapping; | 13 | import org.springframework.web.bind.annotation.GetMapping; |
| 13 | import org.springframework.web.bind.annotation.RequestMapping; | 14 | import org.springframework.web.bind.annotation.RequestMapping; |
| 15 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 14 | import org.springframework.web.bind.annotation.RestController; | 16 | import org.springframework.web.bind.annotation.RestController; |
| 15 | 17 | ||
| 16 | import javax.validation.Valid; | 18 | import javax.validation.Valid; |
| @@ -40,4 +42,14 @@ public class AppBrokerageRecordController { | @@ -40,4 +42,14 @@ public class AppBrokerageRecordController { | ||
| 40 | return success(new PageResult<>(asList(vo1, vo2), 10L)); | 42 | return success(new PageResult<>(asList(vo1, vo2), 10L)); |
| 41 | } | 43 | } |
| 42 | 44 | ||
| 45 | + @GetMapping("/get-product-brokerage-price") | ||
| 46 | + @Operation(summary = "获得商品的分销金额") | ||
| 47 | + public CommonResult<AppBrokerageProductPriceRespVO> getProductBrokeragePrice(@RequestParam("spuId") Long spuId) { | ||
| 48 | + AppBrokerageProductPriceRespVO respVO = new AppBrokerageProductPriceRespVO(); | ||
| 49 | + respVO.setEnabled(true); // TODO @疯狂:需要开启分销 + 人允许分销 | ||
| 50 | + respVO.setBrokerageMinPrice(1); | ||
| 51 | + respVO.setBrokerageMaxPrice(2); | ||
| 52 | + return success(respVO); | ||
| 53 | + } | ||
| 54 | + | ||
| 43 | } | 55 | } |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/brokerage/vo/record/AppBrokerageProductPriceRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.trade.controller.app.brokerage.vo.record; | ||
| 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 AppBrokerageProductPriceRespVO { | ||
| 9 | + | ||
| 10 | + @Schema(description = "是否开启", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | ||
| 11 | + private Boolean enabled; | ||
| 12 | + | ||
| 13 | + @Schema(description = "分销最小金额,单位:分", example = "100") | ||
| 14 | + private Integer brokerageMinPrice; | ||
| 15 | + | ||
| 16 | + @Schema(description = "分销最大金额,单位:分", example = "100") | ||
| 17 | + private Integer brokerageMaxPrice; | ||
| 18 | + | ||
| 19 | +} |