Newer
Older
newfiber-termite / newfiber-termites / newfiber-termites-dataup / src / main / java / com / newfiber / termite / controller / StatisticsController.java
@xiongkai xiongkai on 2 Sep 2 KB 项目统计接口
package com.newfiber.termite.controller;

import com.newfiber.common.core.web.controller.BaseController;
import com.newfiber.common.core.web.domain.Result;
import com.newfiber.termite.domain.request.statistic.ProjectStatisticRequest;
import com.newfiber.termite.domain.request.statistic.SiteWarnDailySeqStatisticRequest;
import com.newfiber.termite.domain.request.statistic.SiteWarnTotalCountStatisticRequest;
import com.newfiber.termite.domain.response.statistic.ProjectStatistic;
import com.newfiber.termite.domain.response.statistic.SiteDailyWarnCount;
import com.newfiber.termite.domain.response.statistic.SiteTotalWarnCount;
import com.newfiber.termite.service.IStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author X.K
 * @date 2024-05-27
 */
@RestController
@RequestMapping("/statistics")
@Api(value = "统计", tags = "统计")
public class StatisticsController extends BaseController {

    @Resource
    private IStatisticsService statisticsService;

    /**
     */
    @GetMapping("/warn_date_seq_statistic")
    @ApiOperation(value = "告警日期时间序列统计", position = 50)
    public Result<Map<String, List<SiteDailyWarnCount>>> warnDailySeqStatistic(SiteWarnDailySeqStatisticRequest request) {
        Map<String, List<SiteDailyWarnCount>> response = statisticsService.warnDailySeqStatistic(request);
        return success(response);
    }

    /**
     */
    @GetMapping("/site_warn_total_count_statistic")
    @ApiOperation(value = "累计告警次数统计", position = 50)
    public Result<List<SiteTotalWarnCount>> siteWarnTotalCountStatistic(SiteWarnTotalCountStatisticRequest request) {
        List<SiteTotalWarnCount> response = statisticsService.siteWarnTotalCountStatistic(request);
        return success(response);
    }

    /**
     */
    @GetMapping("/project_statistic")
    @ApiOperation(value = "项目信息统计", position = 50)
    public Result<ProjectStatistic> siteWarnTotalCountStatistic(ProjectStatisticRequest request) {
        return success(new ProjectStatistic());
    }

}