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

import java.util.List;

/**
 * title: MemberFeign
 * package: com.sptg.estate.api.feigns
 * description:实施项目-服务接口
 *
 *               
 *                
 */
@FeignClient(value= "smart-house-estate",fallbackFactory= ProjectFeignFallbackFactory.class)
public interface ProjectFeign {

    /**
     * 功能描述:分页查询
     * @param projectDto
     * @return ResultBean<Page<Project>>
     *               
     *                      
     */
    @PostMapping(value = "/implement/project/showList")
    ResultBean<Page<Project>> showList(@RequestBody ProjectDto projectDto);
    /**
     * 功能描述:分页查询--小程序
     * @param projectDto
     * @return ResultBean<Page<Project>>
     *               
     *                      
     */
    @PostMapping(value = "/implement/project/showListInstallation")
    ResultBean<Page<Project>> showListInstallation(ProjectDto projectDto);
    /**
     * 功能描述:分页查询--小程序
     * @param projectDto
     * @return ResultBean<Page<Project>>
     *               
     *                      
     */
    @PostMapping(value = "/implement/project/showListTest")
    ResultBean<Page<Project>> showListTest(ProjectDto projectDto);
    /**
     * 功能描述:通过小区id获取项目信息
     * @param residentialId
     * @return Project
     *               
     *                      
     */
    @PostMapping(value = "/implement/project/findByResidentialId")
    ResultBean<Project> findByResidentialId(@RequestBody Long residentialId);
    /**
     * 功能描述:新增项目
     * @param project
     * @return ResultBean<Boolean>
     *               
     *                      
     */
    @PostMapping(value = "/implement/project/insert")
    ResultBean<Boolean> insert(@RequestBody Project project);
    /**
     * 功能描述:修改
     * @param project
     * @return Project
     *               
     *                      
     */
    @PostMapping(value = "/implement/project/updateById")
    ResultBean<Boolean> updateById(@RequestBody Project project);
    /**
     * 功能描述:检测小区关联的小区项目数量，一个小区只能创建一个项目
     * @param residentialId 小区id
     * @return ResultBean<Boolean>
     *               
     *                      
     */
    @PostMapping(value = "/implement/project/countByResidentialId")
    ResultBean<Boolean> countByResidentialId(@RequestBody Long residentialId);
    /**
     * 功能描述:根据id查询
     * @param id
     * @return ResultBean<Boolean>
     *               
     *                      
     */
    @PostMapping(value = "/implement/project/findById")
    ResultBean<Project> findById(@RequestBody Long id);
    /**
     * 功能描述:编辑
     * @param project
     * @return ResultBean<Boolean>
     *               
     *                      
     */
    @PostMapping(value = "/implement/project/edit")
    ResultBean<Boolean> edit(@RequestBody Project project);

    /**
     * 功能描述:根据位置查询所属项目
     * @param projectDto{
     *         orgPosition : 位置 必填
     * }
     * @return ResultBean<Project>
     *             
     *                      
     */
    @PostMapping(value = "/implement/project/findListByPosition")
    ResultBean<Project> findListByPosition(@RequestBody ProjectDto projectDto);
    /**
     * 功能描述:根据位置统计项目数量
     * @param orgPosition
     * @return ResultBean<Project>
     *               
     *                      
     */
    @PostMapping(value = "/implement/project/countByOrgPosition")
    ResultBean<Integer> countByOrgPosition(@RequestBody String orgPosition);
    /**
     * 功能描述:添加项目信息--小程序端专用
     * @param dto
     * @return ResultBean<Project>
     *               
     *                      
     */
    @PostMapping(value = "/implement/project/insertProjectAndContract")
    ResultBean<Boolean> insertProjectAndContract(@RequestBody ProjectDto dto);
    /**
     * 功能描述:根据id集合查询数据
     * @param idList
     * @return ResultBean<Project>
     *               
     *                      
     */
    @PostMapping(value = "/implement/project/findListByXqIds")
    List<Project> findListByXqIds(@RequestBody List<Long> idList);

}
