package org.springblade.estate.feign;

import com.baomidou.mybatisplus.plugins.Page;
import io.swagger.annotations.ApiParam;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.tool.api.R;
import org.springblade.estate.dto.CarDTO;
import org.springblade.estate.entity.Car;
import org.springblade.estate.vo.CarVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.messaging.handler.annotation.MessageExceptionHandler;
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 org.springblade.core.mp.support.Query;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;

/**
 * 车辆信息 Feign
 *
 * @author lianghanqiang
 * @since 2021-03-30
 */
@FeignClient(value = "cyzh-estate",path = "/feign/car")
public interface ICarClient  {

	/**
	 * 详情
	 */
	@GetMapping("/detail")
    CarVO detail(@SpringQueryMap Car car);

	/**
	 * 查询 车辆信息
	 */
	@GetMapping("/list")
    List<CarVO> list(@SpringQueryMap Car car);



	/**
	 * 新增 车辆信息
	 */
	@PostMapping("/save")
	boolean save(@Valid @RequestBody Car car);

	/**
	 * 修改 车辆信息
	 */
	@PostMapping("/update")
    boolean update(@Valid @RequestBody Car car);

	/**
	 * 新增或修改 车辆信息
	 */
	@PostMapping("/submit")
    boolean submit(@Valid @RequestBody Car car);


	/**
	 * 删除 车辆信息
	 */
	@PostMapping("/remove")
    boolean remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids);


	/**
	 * 分页获取车辆
	 * @param carDto
	 * @return
	 */
	@PostMapping("/page")
	R<BladePage<CarVO>> page(@RequestBody CarDTO carDto);
}
