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.AcceptanceDto;
import com.sptg.estate.api.entity.Acceptance;
import com.sptg.estate.api.feigns.fallback.AcceptanceFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * title: PositionFeign
 * package: com.sptg.estate.api.feigns
 * description: 竣工验收-服务接口
 */
@FeignClient(value = "smart-house-estate", fallbackFactory = AcceptanceFeignFallbackFactory.class)
public interface AcceptanceFeign {
    /**
     * 功能描述:检测项目是否已经创建定位记录
     *
     * @param projectId
     * @return ResultBean<Boolean>
     */
    @PostMapping("/implement/acceptance/countByProjectId")
    ResultBean<Boolean> countByProjectId(@RequestBody Long projectId);

    /**
     * 功能描述:新增
     *
     * @param dto
     * @return ResultBean<Boolean>
     */
    @PostMapping("/implement/acceptance/insert")
    ResultBean<Boolean> insert(@RequestBody AcceptanceDto dto);

    /**
     * 功能描述:根据机构位置统计数量
     *
     * @param orgPosition
     * @return ResultBean<Integer>
     */
    @PostMapping("/implement/acceptance/countByOrgPosition")
    ResultBean<Integer> countByOrgPosition(@RequestBody String orgPosition);

    /**
     * 功能描述:分页查询
     *
     * @param acceptanceDto
     * @return ResultBean<Page < Acceptance>>
     */
    @PostMapping("/implement/acceptance/showList")
    ResultBean<Page<Acceptance>> showList(@RequestBody AcceptanceDto acceptanceDto);

    /**
     * 功能描述:修改
     *
     * @param acceptance
     * @return ResultBean<Page < Acceptance>>
     */
    @PostMapping("/implement/acceptance/edit")
    ResultBean<Boolean> edit(@RequestBody Acceptance acceptance);

    /**
     * 功能描述:审核
     *
     * @param dto
     * @return ResultBean<Boolean>
     */
    @PostMapping("/implement/acceptance/checkState")
    ResultBean<Boolean> checkState(@RequestBody AcceptanceDto dto);

    /**
     * 功能描述:查询
     *
     * @param id
     * @return ResultBean<Boolean>
     */
    @PostMapping("/implement/acceptance/findById")
    ResultBean<Acceptance> findById(@RequestBody Long id);
}
