package com.sptg.estate.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.estate.api.dto.ParkingLotDto;
import com.sptg.estate.api.entity.ParkingLot;
import com.sptg.estate.api.entity.ParkingLot;
import com.sptg.estate.api.feigns.fallback.ParkingLotFeignFallbackFactory;
import com.sptg.estate.api.feigns.fallback.ParkingLotFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "smart-house-estate",fallbackFactory = ParkingLotFeignFallbackFactory.class)
public interface ParkingLotFeign {

    /**
     * 分页
     * @param dto
     * @return
     */
    @PostMapping(value = "/parkingLot/page")
    ResultBean<Page<ParkingLot>> page(@RequestBody ParkingLotDto dto);

    /**
     * 新增
     * @param dto
     * @return
     */
    @PostMapping(value = "/parkingLot/add")
    ResultBean<Boolean> add(@RequestBody ParkingLotDto dto);

    /**
     * 修改
     * @param dto
     * @return
     */
    @PostMapping(value = "/parkingLot/edit")
    ResultBean<Boolean> edit(@RequestBody ParkingLotDto dto);

    /**
     * 删除
     * @param dto
     * @return
     */
    @PostMapping(value = "/parkingLot/delete")
    ResultBean<Boolean> delete(@RequestBody ParkingLotDto dto);

    @PostMapping(value = "/parkingLot/getById")
    ParkingLot getById(@RequestBody Long id);
}
