-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master-jdk17' of https://gitee.com/zhijiantianya/yudao-…
…cloud # Conflicts: # pom.xml # yudao-dependencies/pom.xml
- Loading branch information
Showing
35 changed files
with
588 additions
and
63 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...otion-api/src/main/java/cn/iocoder/yudao/module/promotion/api/point/PointActivityApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package cn.iocoder.yudao.module.promotion.api.point; | ||
|
||
import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
import cn.iocoder.yudao.module.promotion.api.point.dto.PointValidateJoinRespDTO; | ||
import cn.iocoder.yudao.module.promotion.enums.ApiConstants; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.Parameters; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PutMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory = | ||
@Tag(name = "RPC 服务 - 秒杀活动") | ||
public interface PointActivityApi { | ||
|
||
String PREFIX = ApiConstants.PREFIX + "/point-activity"; | ||
|
||
@GetMapping(PREFIX + "/validate-join") | ||
@Operation(summary = "【下单前】校验是否参与积分商城活动") | ||
@Parameters({ | ||
@Parameter(name = "activityId", description = "活动编号", required = true, example = "1"), | ||
@Parameter(name = "skuId", description = "SKU 编号", required = true, example = "2"), | ||
@Parameter(name = "count", description = "数量", required = true, example = "3"), | ||
}) | ||
CommonResult<PointValidateJoinRespDTO> validateJoinPointActivity(@RequestParam("activityId") Long activityId, | ||
@RequestParam("skuId") Long skuId, | ||
@RequestParam("count")Integer count); | ||
|
||
@PutMapping(PREFIX + "/update-stock-decr") | ||
@Operation(summary = "更新积分商品库存(减少)") | ||
@Parameters({ | ||
@Parameter(name = "id", description = "活动编号", required = true, example = "1"), | ||
@Parameter(name = "skuId", description = "SKU 编号", required = true, example = "2"), | ||
@Parameter(name = "count", description = "数量", required = true, example = "3"), | ||
}) | ||
CommonResult<Boolean> updatePointStockDecr(@RequestParam("id") Long id, | ||
@RequestParam("skuId") Long skuId, | ||
@RequestParam("count")Integer count); | ||
|
||
@PutMapping(PREFIX + "/update-stock-incr") | ||
@Operation(summary = "更新积分商城商品库存(增加)") | ||
@Parameters({ | ||
@Parameter(name = "id", description = "活动编号", required = true, example = "1"), | ||
@Parameter(name = "skuId", description = "SKU 编号", required = true, example = "2"), | ||
@Parameter(name = "count", description = "数量", required = true, example = "3"), | ||
}) | ||
CommonResult<Boolean> updatePointStockIncr(@RequestParam("id") Long id, | ||
@RequestParam("skuId") Long skuId, | ||
@RequestParam("count")Integer count); | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
...c/main/java/cn/iocoder/yudao/module/promotion/api/point/dto/PointValidateJoinRespDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package cn.iocoder.yudao.module.promotion.api.point.dto; | ||
|
||
import lombok.Data; | ||
|
||
/** | ||
* 校验参与积分商城 Response DTO | ||
*/ | ||
@Data | ||
public class PointValidateJoinRespDTO { | ||
|
||
/** | ||
* 可兑换次数 | ||
*/ | ||
private Integer count; | ||
/** | ||
* 所需兑换积分 | ||
*/ | ||
private Integer point; | ||
/** | ||
* 所需兑换金额,单位:分 | ||
*/ | ||
private Integer price; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...n-biz/src/main/java/cn/iocoder/yudao/module/promotion/api/point/PointActivityApiImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package cn.iocoder.yudao.module.promotion.api.point; | ||
|
||
import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
import cn.iocoder.yudao.module.promotion.api.point.dto.PointValidateJoinRespDTO; | ||
import cn.iocoder.yudao.module.promotion.service.point.PointActivityService; | ||
import jakarta.annotation.Resource; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
|
||
/** | ||
* 积分商城活动 Api 接口实现类 | ||
* | ||
* @author HUIHUI | ||
*/ | ||
@RestController // 提供 RESTful API 接口,给 Feign 调用 | ||
@Validated | ||
public class PointActivityApiImpl implements PointActivityApi { | ||
|
||
@Resource | ||
private PointActivityService pointActivityService; | ||
|
||
@Override | ||
public CommonResult<PointValidateJoinRespDTO> validateJoinPointActivity(Long activityId, Long skuId, Integer count) { | ||
return success(pointActivityService.validateJoinPointActivity(activityId, skuId, count)); | ||
} | ||
|
||
@Override | ||
public CommonResult<Boolean> updatePointStockDecr(Long id, Long skuId, Integer count) { | ||
pointActivityService.updatePointStockDecr(id, skuId, count); | ||
return success(true); | ||
} | ||
|
||
@Override | ||
public CommonResult<Boolean> updatePointStockIncr(Long id, Long skuId, Integer count) { | ||
pointActivityService.updatePointStockIncr(id, skuId, count); | ||
return success(true); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.