package com.yida.data.attendance.controller.out;

import com.yida.data.attendance.service.EduAttendanceDeviceService;
import com.yida.data.attendance.vo.OnlineCountVO;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.system.Dept;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "考勤-设备", value = "考勤")
@RestController
@RequestMapping("/out/device")
@RequiredArgsConstructor
public class OutEduAttendanceDeviceController {

    private final EduAttendanceDeviceService eduAttendanceDeviceService;

    @ApiOperation("获取面板机状态分布")
    @GetMapping("/getOnlineDistrib")
    public ResultBean<OnlineCountVO> getOnlineDistrib(Long[] schoolIds) {
        return ResultBean.buildSuccess(eduAttendanceDeviceService.getOnlineDistrib(Arrays.asList(schoolIds)));
    }
}
