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.ServerUserDto;
import com.sptg.estate.api.entity.ServerUser;
import com.sptg.estate.api.entity.ServerUserDetail;
import com.sptg.estate.api.entity.ServerUserFaceImage;
import com.sptg.estate.api.feigns.fallback.ServerUserFeignFallbackFactory;
import com.sptg.estate.api.vo.DevicesAccessPushVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * title: ServerUserFeign
 * package: com.sptg.estate.api.feigns
 * description: 服务人员-服务接口
 *
 *
 *
 */
@FeignClient(value = "smart-house-estate",fallbackFactory = ServerUserFeignFallbackFactory.class)
public interface ServerUserFeign {
    /**
     * 功能描述:服务人员列表查询
     * @param serverUserDto
     * @return ResultBean<Page<ServerUser>>
     *
     *
     */
    @PostMapping(value = "/serverUser/showServerUserList")
    ResultBean<Page<ServerUser>> showServerUserList(@RequestBody ServerUserDto serverUserDto);

    @PostMapping(value = "/serverUser/pagingByServerUserIds")
    ResultBean<Page<ServerUser>> pagingByServerUserIds(@RequestBody ServerUserDto serverUserDto);

    /**
     * 功能描述:添加服务人员
     * @param serverUser
     * @return  ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/serverUser/insertOrUpdateServerUser")
    ResultBean<Boolean> insertOrUpdateServerUser(@RequestBody ServerUser serverUser);
    /**
     * 功能描述:通过id查询服务人员
     * @param id
     * @return ResultBean<ServerUser>
     *
     *
     */
    @PostMapping(value = "/serverUser/findServerUserById")
    ResultBean<ServerUser> findServerUserById(@RequestParam(value ="id") long id);
    /**
     * 功能描述:根据id删除服务人员
     * @param id
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/serverUser/deleteServerUser")
    ResultBean<Boolean> deleteServerUser(@RequestParam(value = "id") long id);
    /**
     * 功能描述:批量删除服务人员
     * @param serverUserDto
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/serverUser/deleteServerUserList")
    ResultBean<Boolean> deleteServerUserList(@RequestBody ServerUserDto serverUserDto);
    /**
     * 功能描述:更新服务人员启用状态
     * @param id
     * @param enable
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/serverUser/updateIsEnable")
    ResultBean<Boolean> updateIsEnable(@RequestParam(value = "id") long id, @RequestParam(value = "enable") int enable);

    /**
     * 功能描述:添加服务人员人脸图片
     * @param serverUserFaceImage
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/serverUser/insertServerUserFaceImage")
    ResultBean<Boolean> insertServerUserFaceImage(@RequestBody ServerUserFaceImage serverUserFaceImage);

    /**
     * 功能描述:删除服务人员人脸图片
     * @param serverUserFaceImage
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/serverUser/deleteServerUserFaceImage")
    ResultBean<Boolean> deleteServerUserFaceImage(@RequestBody ServerUserFaceImage serverUserFaceImage);

    /**
     * 功能描述:添加修改服务人员开门权限（保存人脸，门禁卡信息）
     * @param serverUser
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/serverUser/addOrEditOpenPermission")
    ResultBean<Boolean> addOrEditOpenPermission(@RequestBody ServerUser serverUser);

    /**
     * 功能描述:下发或禁用服务人员开门权限
     * @param devicesAccessPushVO
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/serverUser/accessDevicesManualPush")
    ResultBean<Boolean> accessDevicesManualPush(@RequestBody DevicesAccessPushVO devicesAccessPushVO);

    /**
     * 功能描述:id查询服务人员开门权限
     * @param id
     * @return ResultBean<ServerUser>
     *
     *
     */
    @PostMapping(value = "/serverUser/findServerUserCardAndFaceById")
    ResultBean<ServerUser> findServerUserCardAndFaceById(@RequestParam(value = "id") long id);

    /**
     * 功能描述:获取服务人员数量
     * @param serverUserDto
     * @return int
     *
     *
     */
    @PostMapping(value = "/serverUser/getServerUserCount")
    int getServerUserCount(@RequestBody ServerUserDto serverUserDto);

    /**
     * 功能描述:获取服务人员所负责的单元
     * @param serverUserId 服务人员Id
     * @return  List<ServerUserDetail>
     *
     *
     */
    @PostMapping(value = "/serverUser/findServerUserDetailList")
    List<ServerUserDetail> findServerUserDetailList(@RequestParam(value = "serverUserId") long serverUserId);

    @PostMapping(value = "/serverUser/getServerByCondition")
    List<ServerUser> getServerUserByCondition(@RequestBody ServerUserDto serverUserDto);

    @PostMapping(value = "/serverUser/updateServerUserList")
    boolean updateServerUserList(@RequestBody List<ServerUser> serverUserList);
}
