package com.citygis.web.controller;

import com.citygis.common.annotation.Log;
import com.citygis.common.core.domain.AjaxResult;
import com.citygis.common.enums.BusinessType;
import com.citygis.web.service.LookMonitorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: zyl
 * @CreateTime: 2025-01-23
 * @Description: 监控可视化
 * @Version: 1.0
 */
@Api(tags = "监控可视化")
@RestController
@RequestMapping("web/lookMonitor")
public class LookMonitorController {

    @Resource
    LookMonitorService lookMonitorService;

    @Log(title = "监控可视化", businessType = BusinessType.SELECT)
    @ApiOperation("统一接入")
    @GetMapping("/getLookMonitor")
    public AjaxResult getLookMonitor() {
        return lookMonitorService.getLookMonitor();
    }

    @Log(title = "监控可视化", businessType = BusinessType.SELECT)
    @ApiOperation("统一接口监控状态监听")
    @GetMapping("/getLookMonitorByUrlAndStatus")
    public AjaxResult getLookMonitorByUrlAndStatus() {
        return lookMonitorService.getLookMonitorByUrlAndStatus();
    }

    @Log(title = "监控可视化", businessType = BusinessType.SELECT)
    @ApiOperation("数据地图：0接收方，1提供方")
    @GetMapping("/getDataMap/{type}")
    public AjaxResult getDataMap(@PathVariable Integer type) {
        return lookMonitorService.getDataMap(type);
    }

}
