package com.securitycontrol.background.controller;

import com.securitycontrol.background.service.ITodayTaskService;
import com.securitycontrol.common.core.web.controller.BaseController;
import com.securitycontrol.common.core.web.domain.AjaxResult;
import com.securitycontrol.common.core.web.page.TableDataInfo;
import com.securitycontrol.common.log.annotation.Log;
import com.securitycontrol.common.log.enums.OperationType;
import com.securitycontrol.entity.background.dto.TodayTaskDto;
import com.securitycontrol.entity.background.vo.TodayTaskVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author：cwchen
 * @date：2024-03-23-12:40
 * @version：1.0
 * @description：当日任务
 */
@RestController
@RequestMapping("/back/todayTask/")
public class TodayTaskController extends BaseController {

    @Resource(name = "ITodayTaskService")
    private ITodayTaskService service;

    @ApiOperation(value = "获取当日任务列表")
    @GetMapping("getToDayTaskLists")
    @Log(title = "风险值班管理", menu = "风险值班管理->当日任务", grade = OperationType.QUERY_BUSINESS, details = "查询班组", type = "业务日志")
    public TableDataInfo getToDayTaskLists(TodayTaskDto dto) {
        startPage();
        List<TodayTaskVo> list = service.getToDayTaskLists(dto);
        return getDataTable(list);
    }

    @ApiOperation(value = "远程巡视详情")
    @GetMapping("getToDayTaskDetail")
    public AjaxResult getToDayTaskDetail(TodayTaskDto dto) {
        return service.getToDayTaskDetail(dto);
    }

    @ApiOperation(value = "球机上下线时长")
    @GetMapping("getBallTimeList")
    public AjaxResult getBallTimeList(TodayTaskDto dto){
        return service.getBallTimeList(dto);
    }

}
