package com.prolog.eis.feign;

import com.prolog.cs.basic.item.model.vo.ItemBaseInfoVO;
import com.prolog.cs.basic.item.model.vo.ItemSyncQueryByIdVO;
import com.prolog.eis.dto.item.ItemSyncVO;
import com.prolog.framework.common.message.RestMessage;
import com.prolog.framework.core.pojo.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;


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

    /**
     *
     * @param itemSyncQueryByIdVO
     * @return
     */
    @RequestMapping(method = RequestMethod.POST, value = "/itemSync/query")
    RestMessage<Page<ItemSyncVO>> getItemByVo(@RequestBody ItemSyncQueryByIdVO itemSyncQueryByIdVO);


    /**
     * 通过条形码获取商品信息
     * @param barCode
     * @return
     */
    @RequestMapping(method = RequestMethod.GET, value = "/item/basic/list-barcode")
    RestMessage<List<ItemSyncVO>> getItemByBarcode(@RequestParam("barCode") String barCode);

    /**
     * 根据商品名称模糊查询商品全部信息List
     * @param itemName
     * @return
     */
    @RequestMapping(method = RequestMethod.POST, value = "/item/get-by-itemname")
    RestMessage<List<ItemBaseInfoVO>> getItemByName(@RequestParam("itemName") String itemName);

    @PostMapping("/itemSync/query")
    RestMessage<Page<ItemSyncVO>> queryItemMst(@RequestBody ItemSyncQueryByIdVO query);
}
