package com.citygis.web.controller;


import com.citygis.common.annotation.Log;
import com.citygis.common.core.controller.BaseController;
import com.citygis.common.core.page.TableDataInfo;
import com.citygis.common.enums.BusinessType;
import com.citygis.web.domain.*;
import com.citygis.web.service.ITabSystemMsgService;
import io.swagger.annotations.Api;
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;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author citygis
 * @since 2025-01-09
 */
@Api(tags = "统计分析")
@RestController
@RequestMapping("/web/tab-system-msg")
public class TabSystemMsgController extends BaseController {

    @Resource
    ITabSystemMsgService tabSystemMsgService;

    @Log(title = "统计分析管理-统一接入同步结果", businessType = BusinessType.SELECT)
    @ApiOperation("统一接入同步结果")
    @GetMapping("/getTabSystemMsgList")
    public TableDataInfo getTabSystemMsgList(TabSystemMsg tabSystemMsg) {
        startPage();
        return getDataTable(tabSystemMsgService.getTabSystemMsgList(tabSystemMsg));
    }

    @Log(title = "统计分析管理-交换量", businessType = BusinessType.SELECT)
    @ApiOperation("交换量")
    @GetMapping("/getExchangeCount")
    public TableDataInfo getExchangeCount(Exchange exchange) {
        startPage();
        return getDataTable(tabSystemMsgService.getExchangeCount(exchange.getDateTime()));
    }

    @Log(title = "统计分析管理-jkcloud实际量", businessType = BusinessType.SELECT)
    @ApiOperation("jkcloud实际量")
    @GetMapping("/getJkcloudCount")
    public TableDataInfo getJkcloudCount(JkCloudCount jkCloudCount) {
        startPage();
        return getDataTable(tabSystemMsgService.getJkcloudCount());
    }

    @Log(title = "统计分析管理-url当天交换量", businessType = BusinessType.SELECT)
    @ApiOperation("url当天交换量")
    @GetMapping("/getUrlDayCount")
    public TableDataInfo getUrlDayCount(UrlDayCount urlDayCount) {
        startPage();
        return getDataTable(tabSystemMsgService.getUrlDayCount());
    }

    @Log(title = "统计分析管理-topic昨天交换量", businessType = BusinessType.SELECT)
    @ApiOperation("topic昨天交换量")
    @GetMapping("/getTopicCountYesterday")
    public TableDataInfo getTopicCountYesterday(TopicCount topicCount) {
        startPage();
        return getDataTable(tabSystemMsgService.getTopicCountYesterday());
    }

    @Log(title = "统计分析管理-最新操作", businessType = BusinessType.SELECT)
    @ApiOperation("最新操作")
    @GetMapping("/getNew")
    public TableDataInfo getNew(NewCount newCount) {
        startPage();
        return getDataTable(tabSystemMsgService.getNew());
    }


}

