package com.sky.ioc.controller.scene;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.sky.ioc.entity.params.IocParam;
import com.sky.ioc.entity.params.IocTimeRange;
import com.sky.ioc.mapper.job.TokenMapper;
import com.sky.ioc.service.meeting.MeetingRecordService;
import com.sky.ioc.service.meeting.MeetingRoomService;
import com.sky.ioc.tool.ReturnMsg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

import java.util.Map;

@Api(tags ="智慧场景----智会议")
@Slf4j
@RestController
@RequestMapping("/meetingroom")
public class MeetingRoomController {

    @Autowired
    MeetingRoomService meetingRoomService;

    @Autowired
    MeetingRecordService meetingRecordService;

    @ApiOperation("会议室总览")
    @PostMapping("/getMeetingRoomList")
    public ReturnMsg getMeetingRoomList(@RequestParam(value = "date", required=false)String date){
        return meetingRoomService.getMeetingRoomStatus(date);
    }


    @ApiOperation("统计分析--会议总数")
    @PostMapping("/getMeetingTotal")
    public ReturnMsg getMeetingTotal(@RequestBody IocTimeRange iocTimeRange){
        return meetingRecordService.getMeetingRecordTotal(iocTimeRange);
    }


    @ApiOperation("统计分析--会议总次数")
    @PostMapping("/getMeetingTimes")
    public ReturnMsg getMeetingTimes(@RequestBody IocTimeRange iocTimeRange){
        return meetingRecordService.getMeetingAnalysissTimes(iocTimeRange);
    }

    @ApiOperation("统计分析--会议总人次")
    @PostMapping("/getMeetingPersons")
    public ReturnMsg getMeetingPersons(@RequestBody IocTimeRange iocTimeRange){
        return meetingRecordService.getMeetingAnalysissPerson(iocTimeRange);
    }
    @ApiOperation("统计分析--会议时长")
    @PostMapping("/getMeetingMinutes")
    public ReturnMsg getMeetingMinutes(@RequestBody IocTimeRange iocTimeRange){
        return meetingRecordService.getMeetingAnalysissMinutes(iocTimeRange);
    }

    @ApiOperation("统计分析--会议数据分布时长")
    @PostMapping("/getMeetingCakeMinutes")
    public ReturnMsg getMeetingCakeMinutes(@RequestBody IocTimeRange iocTimeRange){
        return meetingRecordService.getMeetingCakeMinutes(iocTimeRange);
    }
    @ApiOperation("统计分析--会议数据分布人数")
    @PostMapping("/getMeetingCakePerson")
    public ReturnMsg getMeetingCakePerson(@RequestBody IocTimeRange iocTimeRange){
        return meetingRecordService.getMeetingCakePerson(iocTimeRange);
    }
}
