package com.yida.data.attendance.feign;

import com.yida.data.attendance.dto.IssuedFaceDTO;
import com.yida.data.attendance.dto.RemoveFaceDTO;
import com.yida.data.attendance.fallback.RemoteAttendanceDeviceServiceFallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.attendance.EduAttendanceDevice;
import com.yida.data.common.core.entity.attendance.EduAttendanceDeviceGroup;
import com.yida.data.common.core.entity.constant.FebsServerConstant;
import java.util.List;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = FebsServerConstant.EDU_ATTENDANCE, contextId = "attendanceDeviceServiceClient",
    fallbackFactory = RemoteAttendanceDeviceServiceFallback.class)
public interface RemoteAttendanceDeviceService {

    @GetMapping("/device/listDeviceBySchool")
    ResultBean<List<EduAttendanceDevice>> listDeviceBySchool(@RequestParam("schoolId") Long schoolId);

    @GetMapping("/in/device/listDeviceByType")
    ResultBean<List<EduAttendanceDevice>> listDeviceByType(@RequestParam("type") String type);

    /**
     * 下发人脸到设备
     */
    @PostMapping("/device/issuedFace")
    ResultBean issuedFace(@RequestBody IssuedFaceDTO dto);

    /**
     * 删除设备中的人脸
     */
    @PostMapping("/device/removeFace")
    ResultBean removeFace(@RequestBody RemoveFaceDTO dto);

    /**
     * 查询设备组中的设备
     */
    @GetMapping("/deviceGroup/listDeviceByGroup")
    ResultBean<List<EduAttendanceDevice>> listDeviceByGroup(@RequestParam("groupIds") Long[] groupIds);

    /**
     * 根据id查询设备
     */
    @GetMapping("/device/listDeviceById")
    ResultBean<List<EduAttendanceDevice>> listDeviceById(@RequestParam("ids") Long[] ids);

    /**
     * 根据id查询设备组
     *
     * @return
     */
    @GetMapping("/deviceGroup/listDeviceGroupById")
    ResultBean<List<EduAttendanceDeviceGroup>> listDeviceGroupById(@RequestParam("ids") Long[] ids);

    /**
     * 更新设备在线状态
     */
    @GetMapping("/in/device/updateDeviceStatus")
    ResultBean updateDeviceStatus();

    /**aaaaaa
     * 校时所有设备
     */
    @GetMapping("/in/device/timingAllDevice")
    ResultBean timingAllDevice();

}
