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

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.yuchen.saas.parking.api.entity.PmgLogParkingCar;
import io.swagger.annotations.ApiOperation;
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.List;

/**
 * @author 吕海泉
 * @create 2021/1/11 9:09
 */


@FeignClient(
		value = AppNameConstant.SAAS_PARKING,
		fallback = PmgLogParkingCarClientFallback.class
)
public interface PmgLogParkingCarClient {

	/**
	 * 根据实体类条件查询列表
	 *
	 * @param pmgLogParkingCar
	 * @return
	 */
	@PostMapping("/logParking/listByEventIndex")
	@ApiOperationSupport(order = 7)
	@ApiOperation(value = "none", notes = "none")
	R<List<PmgLogParkingCar>> listByEventIndex(@RequestBody PmgLogParkingCar pmgLogParkingCar);
	
	/**
	 * 根据停车场编号查询该停车场所有车道的最新压线数据
	 *
	 * @param parkingId 停车场编号
	 * @return
	 */
	@GetMapping("/logParking/getRoadwayLatest")
	@ApiOperationSupport(order = 2)
	@ApiOperation(value = "分页", notes = "传入parkCompany")
	R<List<PmgLogParkingCar>> getRoadwayLatest(@RequestParam("parkingId") String parkingId);

	/**
	 * 根据过车记录ID 查询具体信息
	 *
	 * @param id 过车记录ID
	 * @return
	 */
	@GetMapping("/logParking/getById")
	@ApiOperationSupport(order = 2)
	@ApiOperation(value = "分页", notes = "传入parkCompany")
	R<PmgLogParkingCar> getById(@RequestParam("id") String id);

	/**
	 * 根据过车记录ID更新账单ID
	 * @param LogParkingCarId 过车记录ID
	 * @param billId 账单ID
	 */
	@GetMapping("/logParking/updateBillId")
	@ApiOperationSupport(order = 2)
	@ApiOperation(value = "分页", notes = "传入parkCompany")
	void updateBillId(@RequestParam("LogParkingCarId") Long LogParkingCarId, @RequestParam("billId") Long billId);

	/**
	 * 通过车道id查询当前压线的车辆信息
	 */
	/**
	 * 通过车道id查询当前压线的车辆信息
	 * @param roadwayId 车道ID
	 * @return
	 */
	@GetMapping("/logParking/carLog")
	@ApiOperationSupport(order = 1)
	@ApiOperation(value = "详情", notes = "")
	R<PmgLogParkingCar> carLog(@RequestParam String roadwayId);
}
