package com.sptg.estate.api.feigns;

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

import java.util.List;
import java.util.Map;

/**
 * title: ApplyUserFeign
 * package: com.sptg.estate.biz.security
 * description: 住户申请 服务接口
 *
 *               
 *                      
 */
@FeignClient(value = "smart-house-estate",fallbackFactory = ApplyUserFeignFallbackFactory.class)
public interface ApplyUserFeign {
    /**
     * 功能描述: 检测同一个房间下，同一个名字只能有一条待审核申请记录
     * @param {
     *          room_id:12,
     *          }
     * @return ResultBean<Boolean>
     *               
     *                      
     */
    @PostMapping(value = "/applyUser/checkByNameAndRoomId")
    ResultBean<Boolean> checkByNameAndRoomId(@RequestBody ApplyUser applyUser);
    /**
     * 功能描述: 会员认证住户申请
     * @param applyUser
     * @return ResultBean<Boolean>
     *               
     *                      
     */
    @PostMapping(value = "/applyUser/authentication")
    ResultBean<Boolean> authentication(@RequestBody ApplyUser applyUser);

    /**
     * 功能描述: 获取住户认证列表
     * @param applyUserDto
     * @return ResultBean<Boolean>
     *               
     *                      
     */
    @PostMapping(value = "/applyUser/showApplyUserList")
    ResultBean<Page<ApplyUser>> showApplyUserList(@RequestBody ApplyUserDto applyUserDto);

    /**
     * 功能描述: 根据id查询
     * @param id
     * @return ResultBean<Boolean>
     *               
     *                      
     */
    @PostMapping(value = "/applyUser/getApplyUserById")
    ApplyUser getApplyUserById(@RequestBody Long id);

    /**
     * 功能描述: 审核
     * @param applyUser
     * @return ResultBean<Boolean>
     *               
     *                      
     */
    @PostMapping(value = "/applyUser/updateCheckState")
    ResultBean<Boolean> updateCheckState(@RequestBody ApplyUser applyUser);

    /**
     * 功能描述: 查询会员申请的认证列表
     * @param applyUserDto
     * @return ResultBean<Boolean>
     *               
     *                      
     */
    @PostMapping(value = "/applyUser/getAllApplyUserByMemberId")
    List<ApplyUser> getAllApplyUserByMemberId(@RequestBody ApplyUserDto applyUserDto);

    /**
     * 功能描述: 查询会员申请的认证列表-分页
     * @param applyUserDto
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/applyUser/pagingByMemberId")
    Page<ApplyUser> pagingByMemberId(@RequestBody ApplyUserDto applyUserDto);

    /**
     * 功能描述: 通过房间ID查询会员申请的认证列表-分页
     * @param applyUserDto
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/applyUser/pagingByRoomId")
    Page<ApplyUser> pagingByRoomId(@RequestBody ApplyUserDto applyUserDto);
     /**
     * 功能描述: 查询会员申请的认证列表
     * @param applyUserDto
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/applyUser/getAllApplyUserByRoomId")
    List<ApplyUser> getAllApplyUserByRoomId(@RequestBody ApplyUserDto applyUserDto);

    /**
     * 功能描述:查询不同审核状态的数量
     * @param applyUserDto
     * @return Map<String,Object>
     *                
     *                     
     */
    @PostMapping(value = "/applyUser/applyUserCountForCheckState")
    Map<String,Object> applyUserCountForCheckState(@RequestBody ApplyUserDto applyUserDto);

   /**
    * 功能描述:认证用户数量
    * @param applyUserDto
    * {
    *     checkState 审核状态
    *     orgPosition 机构位置
    * }
    * @return java.lang.Long
    *                
    *                      
    */
    @PostMapping(value = "/applyUser/getApplyUserCount")
    Long getApplyUserCount(@RequestBody ApplyUserDto applyUserDto);

    /**
     * 功能描述: 添加家人申请
     * @param   applyUser
     * @return ResultBean<Boolean>
     *               
     *                      
     */
    @PostMapping(value = "/applyUser/addApplyUser")
    ResultBean<Boolean> addApplyUser(@RequestBody ApplyUser applyUser);

    /**
     * 添加家人申请
     * @param applyUser
     * @return 返回值是申请数据ResultBean<ApplyUser>
     */
    @PostMapping(value = "/applyUser/addApplyUser/returnUser")
    ResultBean<Long> addApplyUserReturnUser(@RequestBody ApplyUser applyUser);

    /**
     * 功能描述: 修改记录（app专用）
     * @param   applyUser
     * @return ResultBean<Boolean>
     *               
     *                      
     */
    @PostMapping(value = "/applyUser/updateApplyUserById")
    ResultBean<Boolean> updateApplyUserById(@RequestBody ApplyUser applyUser);

    /**
     * 功能描述:获取小区内待审核会员数量
     * @param applyUserDto {
     *       residentialId ：小区Id必填
     *       checkState:状态 必填
     * }
     * @return int
     *             
     *                      
     */
    @PostMapping(value = "/applyUser/getApplyUserCountByState")
    Integer getApplyUserCountByState(@RequestBody ApplyUserDto applyUserDto);

    /**
     * 功能描述:分页获取小区待审核会员
     * @param pageBean 查询条件
     * @return ResultBean<Page>
     *             
     *                      
     */
    @PostMapping(value = "/applyUser/getApplyUserPage")
    ResultBean<Page> getApplyUserPage(@RequestBody PageBean<ApplyUser, ApplyUserDto> pageBean);

    @PostMapping(value = "/applyUser/getApplyUserByCondition")
    List<ApplyUser> getApplyUserByCondition(@RequestBody ApplyUserDto applyUserDto);

    @PostMapping(value = "/applyUser/getAuthRoomByMemberId")
    ResultBean<Page<ApplyUser>> getAuthRoomByMemberId(@RequestBody ApplyUserDto applyUserDto);

    @PostMapping(value = "/applyUser/updateApplyUserList")
    boolean updateApplyUserList(@RequestBody List<ApplyUser> applyUserList);

    @PostMapping(value = "/applyUser/deleteApplyUser")
    boolean deleteApplyUser(@RequestBody ApplyUserDto applyUserDto);
}
