代码优化

This commit is contained in:
卢越 2024-09-04 22:55:12 +08:00
parent c935312bf8
commit efd0a86007
2 changed files with 8 additions and 8 deletions

View File

@ -89,13 +89,13 @@ public class CombinationActivityController {
return success(CombinationActivityConvert.INSTANCE.convert(activity, products));
}
@GetMapping("/list")
@GetMapping("/detail-list")
@Operation(summary = "获得拼团活动详情列表")
@Parameter(name = "combinationActivityIds", description = "拼团活动编号列表", required = true, example = "[1,2,3]")
@Parameter(name = "ids", description = "拼团活动编号列表", required = true, example = "[1,2,3]")
@PreAuthorize("@ss.hasPermission('product:spu:query')")
public CommonResult<List<CombinationActivityRespVO>> getCombinationActivityDetailList(@RequestParam("combinationActivityIds") Collection<Long> combinationActivityIds) {
public CommonResult<List<CombinationActivityRespVO>> getCombinationActivityDetailList(@RequestParam("ids") Collection<Long> ids) {
// 查询拼团活动列表
List<CombinationActivityDO> activities = combinationActivityService.getCombinationActivityListByIds(combinationActivityIds);
List<CombinationActivityDO> activities = combinationActivityService.getCombinationActivityListByIds(ids);
// 转换活动列表
List<CombinationActivityRespVO> activityVOs = CombinationActivityConvert.INSTANCE.convertList(activities);

View File

@ -113,12 +113,12 @@ public class AppCombinationActivityController {
return success(CombinationActivityConvert.INSTANCE.convert3(activity, products));
}
@GetMapping("/get-detail-list")
@GetMapping("/detail-list")
@Operation(summary = "获得拼团活动明细")
@Parameter(name = "combinationActivityIds", description = "活动编号列表", required = true, example = "[1024, 1025]")
public CommonResult<List<AppCombinationActivityDetailRespVO>> getCombinationActivityDetailList(@RequestParam("combinationActivityIds") Collection<Long> combinationActivityIds) {
@Parameter(name = "ids", description = "活动编号列表", required = true, example = "[1024, 1025]")
public CommonResult<List<AppCombinationActivityDetailRespVO>> getCombinationActivityDetailList(@RequestParam("ids") Collection<Long> ids) {
// 1. 获取活动
List<CombinationActivityDO> combinationActivityDOList = activityService.getCombinationActivityListByIds(combinationActivityIds);
List<CombinationActivityDO> combinationActivityDOList = activityService.getCombinationActivityListByIds(ids);
// 过滤掉无效的活动
List<CombinationActivityDO> validActivities = combinationActivityDOList.stream()