package com.sky.ioc.controller.work;

import com.sky.ioc.entity.domain.meeting.MeetingRecord;
import com.sky.ioc.entity.params.IocParam;
import com.sky.ioc.service.meeting.MeetingRecordService;
import com.sky.ioc.service.meeting.MeetingRoomService;
import com.sky.ioc.service.space.SpaceService;
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.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * TODO
 *
 * @Description 智慧办公----会议管理
 * @Author LunCe
 * @Date 2023/2/28 15:51
 **/

@Api(tags ="智慧办公----会议管理")
@Slf4j
@RestController
@RequestMapping("/meeting")
public class MeetingController {


    @Autowired
    private SpaceService spaceService;

    @Autowired
    private MeetingRecordService meetingRecordService;

    @Autowired
    MeetingRoomService meetingRoomService;


    @ApiOperation("核心指标")
    @PostMapping("/getMeetingCoreIndicators")
    public ReturnMsg getMeetingCoreIndicators(@RequestBody IocParam iocParam){
        return spaceService.getMeetingCoreIndicators(iocParam);
    }


    @ApiOperation("成本趋势")
    @PostMapping("/getMeetingCostTrend")
    public ReturnMsg getMeetingCostTrend(@RequestBody IocParam iocParam){
        return spaceService.getMeetingCostTrend(iocParam);
    }

    @ApiOperation("会议时长")
    @PostMapping("/getMeetingHours")
    public ReturnMsg getMeetingHours(@RequestBody IocParam iocParam){
        return meetingRoomService.getMeetingInfo(iocParam);
    }



    @ApiOperation("会议室情况(分楼层)")
    @PostMapping("/getConferenceRoomTreeInfo")
    public ReturnMsg getConferenceRoomTreeInfo(@RequestBody IocParam iocParam){
        Map map = meetingRecordService.queryMeetingTreeList(iocParam);
        return ReturnMsg.ok(map);
    }

    @ApiOperation("会议室情况")
    @PostMapping("/getConferenceRoomInfo")
    public ReturnMsg getConferenceRoomInfo(@RequestBody IocParam iocParam){
        List<MeetingRecord> records = meetingRecordService.queryMeetingList(iocParam);
        return ReturnMsg.ok(records);
    }


}
