package org.dromara.monitoring.controller;

import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.monitoring.domain.dto.DelYzd;
import org.dromara.monitoring.domain.dto.MonitoringListDto;
import org.dromara.monitoring.domain.vo.MonList;
import org.dromara.monitoring.domain.vo.MonYsVo;
import org.dromara.monitoring.service.MonitoringYsService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/monitoriing")
/**
 * 监控管理
 */
public class MonitoriingYsColltroller {

    private final MonitoringYsService monitoringYsService;

    /**
     *  获取token
     */
    @GetMapping("/getToken")
    @Log(title = "获取莹石云token", businessType = BusinessType.INSERT)
    public R<String> getysTokenColltroller(){
        return R.ok("ok",monitoringYsService.getYsTokenService());
    }

    /**
     *  获取监控列表
     */
    @PostMapping("/getMonitoringList")
    @Log(title = "获取监控列表", businessType = BusinessType.INSERT)
    public R<MonList> getMonitoringList(@RequestBody MonitoringListDto dto){
        return R.ok("请求成功",monitoringYsService.getMonitoringList(dto));
    }

    /**
     *  获取大屏项目
     */
    @GetMapping("/getMonitoringDp")
    @Log(title = "数据组装", businessType = BusinessType.INSERT)
    public R<MonYsVo> getMonitoringDp(){
        return R.ok("请求成功",monitoringYsService.getMonitoringDp());
    }

    /**
     *  抓拍
     */
    @GetMapping("/capturePho")
    @Log(title = "抓拍接口：未用", businessType = BusinessType.INSERT)
    public R<String> capturePho(@RequestBody DelYzd dto){
        return R.ok("请求成功",monitoringYsService.capturePho(dto));
    }


    @GetMapping("/test")
    public R<Void> test(){
        return R.ok("请求成功",monitoringYsService.test());
    }


}
