package com.yuchen.saas.parking.charge.api.feign;

import com.yuchen.saas.parking.charge.api.dto.PmgBatParkBillLogDto;
import com.yuchen.saas.parking.charge.api.po.ParkingChargingRecord;
import com.yuchen.saas.parking.charge.api.po.ParkingPlaceEvent;
import com.yuchen.saas.parking.charge.api.vo.ChargePlaceIdleCostDetailsVo;
import com.yuchen.saas.parking.charge.api.vo.ParkingBillLogDeatilVo;
import com.yuchen.saas.parking.charge.api.vo.ParkingBillLogExceptionTaskVo;
import com.yuchen.saas.parking.charge.api.vo.PmgBatParkBillLogDeatilVo;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.tool.api.R;
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.Date;
import java.util.List;
import java.util.Map;

@FeignClient(
        value = AppNameConstant.SAAS_PARKING_CHARGE,
        fallback = PlaceIdleCostFeignClientFallback.class
)
public interface PlaceIdleCostFeignClient {

    String ROOT_PATH = "/feign/place/amount";

    String COST = "/cost";

    String NEWCOST = "/newCost";

    String DETAIL = "/detail";

    String EXCEPTION_TASK = "/exceptionTask";

    String EVEN_DETAIL = "/evenDetail";

    String CHARGE_RECORD = "/listByPlateNo";

    @GetMapping(ROOT_PATH + COST)
    R<ChargePlaceIdleCostDetailsVo> cost(@RequestParam("parkingId") Long parkingId,
                                                @RequestParam("plateNo") String plateNo,
                                                @RequestParam("startTime") String startTime,
                                                @RequestParam("endTime") String endTime);


    @GetMapping(ROOT_PATH + NEWCOST)
    R<ChargePlaceIdleCostDetailsVo> newCost(@RequestParam("parkingId") Long parkingId,
                                            @RequestParam("plateNo") String plateNo,
                                            @RequestParam("startTime") String startTime,
                                            @RequestParam("endTime") String endTime);


    @PostMapping(ROOT_PATH + DETAIL)
    R<Map<Long,ParkingBillLogDeatilVo>> detail(@RequestBody List<PmgBatParkBillLogDto> dtoList);

    @PostMapping(ROOT_PATH + EXCEPTION_TASK)
    R<List<ParkingBillLogExceptionTaskVo> > exceptionTask(@RequestBody List<PmgBatParkBillLogDto> dtoList);

    @GetMapping(ROOT_PATH + EVEN_DETAIL)
    R<List<PmgBatParkBillLogDeatilVo>> evenDetail(@RequestParam("parkingId") Long parkingId,
                                                  @RequestParam("plateNo") String plateNo,
                                                  @RequestParam("startTime") String startTime,
                                                  @RequestParam("endTime") String endTime);
    @GetMapping(ROOT_PATH + CHARGE_RECORD)
    R<List<ParkingChargingRecord>> listByPlateNo(@RequestParam("plateNo") String plateNo, @RequestParam("parkingId") Long parkingId, @RequestParam("startTime") String startTime, @RequestParam("endTime")String endTime );
}
