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.ParkingSpaceDto;
import com.sptg.estate.api.entity.ParkingSpace;
import com.sptg.estate.api.feigns.fallback.ParkingSpaceFeignFallbackFactory;
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 = ParkingSpaceFeignFallbackFactory.class)
public interface ParkingSpaceFeign {

    /**
     * 分页
     * @param dto
     * @return
     */
    @PostMapping(value = "/parkingSpace/page")
    ResultBean<Page<ParkingSpace>> page(@RequestBody ParkingSpaceDto dto);

    @PostMapping(value = "/parkingSpace/getById")
    ParkingSpace getById(@RequestBody Long id);

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

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

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