package com.prolog.cs.base.gsp.resource;

import com.prolog.cs.basic.item.model.BaseMtlItemMst;
import com.prolog.cs.basic.item.model.vo.ItemBaseInfoVO;
import com.prolog.framework.common.message.RestMessage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Set;

@FeignClient(value = "${prolog.service.item}")
public interface ItemClient {


    /**
     * 批量查询商品基础信息
     *
     * @return 商品基础信息
     */
    @GetMapping("/item/base/list")
    RestMessage<List<ItemBaseInfoVO>> getItemBaseList(@RequestParam("itemIds") String[] itemIds);

    /**
     * 批量查询商品信息
     *
     * @return 商品信息
     */
    @PostMapping("/item/listbyids")
    RestMessage<List<BaseMtlItemMst>> getListByIds(@RequestBody String[] itemIds);

    /**
     * 根据ID查询商品信息
     *
     * @return 商品信息
     */
    @GetMapping("/item/item-byid")
    RestMessage<BaseMtlItemMst> getItemById(@RequestParam("itemId") String itemId);


    @PostMapping("/item/getByItemCodes")
    RestMessage<List<BaseMtlItemMst>> getByItemCodes(@RequestParam("cargoOwnerId") String cargoOwnerId, @RequestParam("itemCodes") Set<String> itemCode);

}
