package cn.iocoder.yudao.module.basic.api.goodsinfo;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.basic.api.goodsinfo.dto.GoodsInfoRespDTO;
import cn.iocoder.yudao.module.basic.enums.ApiConstants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collection;
import java.util.List;

@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Api(tags = "RPC 服务 - 商品")
public interface GoodsInfoApi {

    String PREFIX = ApiConstants.PREFIX + "/goods-info";

    @GetMapping(PREFIX + "/getAllGoodsList")
    @ApiOperation("查询所有商品")
    CommonResult<List<GoodsInfoRespDTO>> getAllGoodsList();

    @GetMapping(PREFIX + "/getGoodsInfoListByGoodsIds")
    @ApiOperation("根据商品编码查询商品")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "goodsIds", value = "编号列表", required = true, example = "GOCD202304131028TSOC, GOCD202304131724XUXY", dataTypeClass = List.class),
        @ApiImplicitParam(name = "businessInfoId", value = "商户ID", required = true, example = "1", dataTypeClass = List.class)
    })
    CommonResult<List<GoodsInfoRespDTO>> getGoodsInfoListByGoodsIds(@RequestParam("goodsIds") List<String> goodsIds, @RequestParam("businessInfoId") Long businessInfoId);
}
