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.AccessFacePushRecordsDto;
import com.sptg.estate.api.entity.AccessFacePushRecords;
import com.sptg.estate.api.feigns.fallback.AccessFacePushRecordsFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * title: AccessFacePushRecordsFeignFallbackFactory
 * package: com.sptg.estate.api.feigns
 * description: 授权下发记录 服务接口
 *
 *
 *
 */
@FeignClient(value = "smart-house-estate",fallbackFactory = AccessFacePushRecordsFeignFallbackFactory.class)
public interface AccessFacePushRecordsFeign {

    /**
     * 功能描述:授权下发记录查询列表
     *
     * @param accessFacePushRecordsDto 授权下发记录业务对象（含分页及查询条件）
     * @return ResultBean<Page < AccessFacePushRecords>>
     */
    @PostMapping(value = "/accessFacePushRecords/showAccessFacePushRecordsList")
    ResultBean<Page<AccessFacePushRecords>> showAccessFacePushRecordsList(@RequestBody AccessFacePushRecordsDto accessFacePushRecordsDto);

    /**
     * 功能描述:新增授权下发记录
     *
     * @param recordsDto 授权下发记录业务对象
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/accessFacePushRecords/addAccessFacePushRecords")
    ResultBean<Boolean> addAccessFacePushRecords(@RequestBody AccessFacePushRecordsDto recordsDto);

    /**
     * 功能描述:新增授权下发记录，根据下发到的设备数量，批量添加记录
     * @param recordsDto 授权下发记录业务对象
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/accessFacePushRecords/addAccessFacePushRecordsByDevices")
    ResultBean<Boolean> addAccessFacePushRecordsByDevices(@RequestBody AccessFacePushRecordsDto recordsDto);

    /**
     * 功能描述:新增或更新授权下发记录
     *
     * @param recordsDto 授权下发记录业务对象
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/accessFacePushRecords/addOrUpdateAccessFacePushRecords")
    ResultBean<Boolean> addOrUpdateAccessFacePushRecords(@RequestBody AccessFacePushRecordsDto recordsDto);

    /**
     * 根据Id 查找授权下发记录
     *
     * @param id 必填
     * @return AccessFacePushRecords
     */
    @GetMapping(value = "/accessFacePushRecords/findAccessFacePushRecordsById/{id}")
    AccessFacePushRecords findAccessFacePushRecordsById(@PathVariable(value = "id") Long id);

    /**
     * 根据Id 查找授权下发记录
     *
     * @param userId 必填
     * @return AccessFacePushRecords
     */
    @GetMapping(value = "/accessFacePushRecords/findAccessFacePushRecordsById/{userId}")
    List<AccessFacePushRecords> findAccessFacePushRecordsByUserId(@PathVariable(value = "userId") Long userId);

    /**
     * 功能描述:编辑授权下发记录
     *
     * @param accessFacePushRecordsDto 授权下发记录业务对象
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/accessFacePushRecords/updateAccessFacePushRecords")
    ResultBean<Boolean> updateAccessFacePushRecords(@RequestBody AccessFacePushRecordsDto accessFacePushRecordsDto);

    /**
     * 功能描述:删除授权下发记录
     *
     * @param accessFacePushRecordsDto 授权下发记录业务对象
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/accessFacePushRecords/deleteAccessFacePushRecords")
    ResultBean<Boolean> deleteAccessFacePushRecords(@RequestBody AccessFacePushRecordsDto accessFacePushRecordsDto);

    /**
     * 功能描述:查询授权下发数量
     *
     * @param accessFacePushRecordsDto
     * @return Long
     */
    @PostMapping(value = "/accessFacePushRecords/getAccessFacePushRecordsCount")
    Long getAccessFacePushRecordsCount(@RequestBody AccessFacePushRecordsDto accessFacePushRecordsDto);

    /**
     * 功能描述:根据userId查询
     *
     * @param userId
     * @return ResultBean<AccessFacePushRecords>
     */
    @PostMapping(value = "/accessFacePushRecords/getListByUserId/{userId}/{accessUserType}/{specialDevice}")
    ResultBean<AccessFacePushRecords> getListByUserId(@PathVariable("userId") Long userId, @PathVariable("accessUserType") Integer accessUserType, @PathVariable("specialDevice") Integer specialDevice);

}
