package com.prolog.eis.feign;

import com.alibaba.fastjson.JSONObject;
import com.prolog.eis.core.model.base.area.WhArea;
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.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.Map;


@FeignClient(value = "${prolog.service.warehouse}")
public interface WarehouseFeignService {

    @PostMapping("/eisWhArea/getAreaByLocation")
    RestMessage<WhArea> getAreaByLocation(@RequestParam(value = "location", required = false) String location);

    @PostMapping("/eisLocator/batchQueryLocation")
    RestMessage<List<WhArea>> batchQueryLocation(@RequestBody JSONObject req);

    //获取区域总货位数
    @PostMapping("/eisLocator/findTotalCountByAreaNo")
    RestMessage<Map<String, Integer>> findTotalCountByAreaNo(@RequestParam("area") String area);

    @GetMapping("/eisWhArea/getAll-storeArea")
    RestMessage<Page<WhArea>> getAll_storeArea(@RequestParam(value = "areaNo", required = false) String areaNo,
                                              @RequestParam(value = "areaType", required = false) String areaType,
                                              @RequestParam(value = "pageNum", required = true) Integer pageNum,
                                              @RequestParam(value = "pageSize", required = true) Integer pageSize);

}
