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.AccessCardPushRecordsDto;
import com.sptg.estate.api.entity.AccessCardPushRecords;
import com.sptg.estate.api.feigns.fallback.AccessCardPushRecordsFeignFallbackFactory;
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: AccessCardPushRecordsFeignFallbackFactory
 * package: com.sptg.estate.api.feigns
 * description: 授权下发记录 服务接口
 *
 *
 *
 */
@FeignClient(value = "smart-house-estate",fallbackFactory = AccessCardPushRecordsFeignFallbackFactory.class)
public interface AccessCardPushRecordsFeign {

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

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

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

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

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

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

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

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

    /**
     * 功能描述:查询授权下发数量
     *
     * @param accessCardPushRecordsDto
     * @return Long
     */
    @PostMapping(value = "/accessCardPushRecords/getAccessCardPushRecordsCount")
    Long getAccessCardPushRecordsCount(@RequestBody AccessCardPushRecordsDto accessCardPushRecordsDto);

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

}
