【同步】BOOT 和 CLOUD 的功能
This commit is contained in:
@@ -16,6 +16,9 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import jakarta.validation.Valid;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 商品 SKU")
|
||||
@@ -33,6 +36,16 @@ public interface ProductSkuApi {
|
||||
@Parameter(name = "ids", description = "SKU 编号列表", required = true, example = "1024,2048")
|
||||
CommonResult<List<ProductSkuRespDTO>> getSkuList(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 批量查询 SKU MAP
|
||||
*
|
||||
* @param ids SKU 编号列表
|
||||
* @return SKU MAP
|
||||
*/
|
||||
default Map<Long, ProductSkuRespDTO> getSkuMap(Collection<Long> ids) {
|
||||
return convertMap(getSkuList(ids).getCheckedData(), ProductSkuRespDTO::getId);
|
||||
}
|
||||
|
||||
@GetMapping(PREFIX + "/list-by-spu-id")
|
||||
@Operation(summary = "批量查询 SKU 信息")
|
||||
@Parameter(name = "spuIds", description = "SPU 编号列表", required = true, example = "1024,2048")
|
||||
|
||||
@@ -33,7 +33,7 @@ public interface ProductSpuApi {
|
||||
* @param ids SPU 编号列表
|
||||
* @return SPU MAP
|
||||
*/
|
||||
default Map<Long, ProductSpuRespDTO> getSpusMap(Collection<Long> ids) {
|
||||
default Map<Long, ProductSpuRespDTO> getSpuMap(Collection<Long> ids) {
|
||||
return convertMap(getSpuList(ids).getCheckedData(), ProductSpuRespDTO::getId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user