package com.xxfc.platform.vehicle.feign;

import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.GoodDataVO;
import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.entity.*;
import com.xxfc.platform.vehicle.pojo.CompanyDetail;
import com.xxfc.platform.vehicle.pojo.RentVehicleBookDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

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

/**
 * Created by ace on 2017/9/15.
 */
@FeignClient(name = "vehicle")
public interface VehicleFeign {
    @GetMapping(value = "/vehicleModel/{id}")
    public ObjectRestResponse<VehicleModel> get(@PathVariable(value = "id") int id);

    @GetMapping(value = "/vehicleInfo/{id}")
    public ObjectRestResponse<Vehicle> get(@PathVariable(value = "id") String id);

    @RequestMapping(value = "/vehicleInfo/findById", method = RequestMethod.GET)
    public RestResponse<Vehicle> findById(@RequestParam(value = "id")String id);

    @RequestMapping(value = "/vehicleInfo/getByIds", method = RequestMethod.GET)
    public RestResponse< List<Vehicle>> getByIds(@RequestParam(value = "ids") List<String> id);

    //修改评分
    @RequestMapping(value = "/vehicleModel/app/addScore", method = RequestMethod.GET)
    public RestResponse addScore(@RequestParam(value="id")Integer  id, @RequestParam(value="score")Integer  score);

    @RequestMapping(value = "/vehicleInfo/rent/book/vehicle", method = RequestMethod.POST)
    public ObjectRestResponse<VehicleBookRecord> rentApplyVehicle(@RequestBody RentVehicleBookDTO rentVehicleBookDTO);

    @RequestMapping(value ="/branchCompany/app/unauth/detail/{id}",method = RequestMethod.GET)
    public ObjectRestResponse<CompanyDetail> getCompanyDetail(@PathVariable(value = "id") Integer id);

    //租车拒绝预约
    @RequestMapping(value = "/vehicleInfo/rent/book/reject/{bookRecordId}", method = RequestMethod.PUT)
    public RestResponse<Integer> rentRejectVehicleBooking(@PathVariable(value = "bookRecordId") Long bookRecordId);

    //取消预约
    @RequestMapping(value = "/vehicleInfo/unbook/4employee/{bookRecordId}", method = RequestMethod.DELETE)
    public RestResponse<Integer> unbookVehicle(@PathVariable(value = "bookRecordId") Long bookRecordId);

    //通过预约
    @RequestMapping(value = "/vehicleInfo/book/4employee/prove/{bookRecordId}", method = RequestMethod.PUT)
    public RestResponse<Integer> proveVehicleBooking(@PathVariable(value = "bookRecordId") Long bookRecordId);

    //获取分公司列表
    @GetMapping("/branchCompany/all")
    public  List<BranchCompany>  companyAll(
            @RequestParam(value = "dataAll")Integer dataAll,
            @RequestParam(value = "dataCompany")String dataCompany,
            @RequestParam(value = "dataZone")String dataZone);

    @GetMapping("/branchCompany/entityList")
    public ObjectRestResponse<List<BranchCompany>> branchCompanyEntityList(@RequestParam("entity") Map<String, Object> entity);

    @RequestMapping(value = "/user/license/one", method = RequestMethod.GET)
    public RestResponse<VehicleUserLicense> one(@RequestParam(value="id",defaultValue="0")Integer  id) throws Exception;

    @RequestMapping(value = "/user/license/company/getOne", method = RequestMethod.GET)
    public RestResponse<VehicleUserLicense> getOne(
            @RequestParam(value="id",defaultValue="0")Integer  id) throws Exception ;

    /**
     * 获取优质车型接口
     * @param page
     * @param limit
     * @return 返回
     */
    @GetMapping(value = "/vehicleModel/goodList")
    List<GoodDataVO> goodList(@RequestParam(value = "page") Integer page, @RequestParam("limit") Integer limit);

    /**
     * 根据一个id获取城市
     * @param id
     * @return
     */
    @GetMapping("/sysRegion/getSysRegionById/{id}")
   RestResponse getSysRegionById(@PathVariable(value = "id") Integer id);
    /**
     * 多个城市code获取城市代码
     * @param idSet
     * @return
     */
    @PostMapping("/sysRegion/getSysRegion")
    ObjectRestResponse<List<SysRegion>> getSysRegion(Set<Integer> idSet);

    /**
     * 获取公司所在的城市
     * @param zoneList
     * @param companyList
     * @return
     */
    @GetMapping("/city/corporationCity")
    ObjectRestResponse<Set<Integer>> corporationCity( @RequestParam(value = "zoneList") String zoneList,
                                                       @RequestParam(value = "companyList") String companyList);
}
