package com.jay.monitor.data.server.report.mysql;

import com.jay.monitor.data.server.daos.JayMonitorUrlMapperExt;
import com.jay.monitor.data.server.models.dto.report.SlowGroupModel;
import com.jay.monitor.data.server.report.TopSlowTimeListReport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Module TODO
 * @Description TODO
 * @Author liukaixiong
 * @Date 2020/12/14 11:01
 */
//@Component
public class CountUrlTopReportInvoke implements TopSlowTimeListReport<SlowGroupModel> {

    private String reportName = "URL请求总数排行-TOP 10";

    @Autowired
    private JayMonitorUrlMapperExt urlMapperExt;

    @Override
    public String reportName() {
        return reportName;
    }

    @Override
    public List<SlowGroupModel> getListData(String reportDate) {
        List<SlowGroupModel> slowGroupModels = urlMapperExt.selectByUrlCountGroupList(reportDate);
        return slowGroupModels;
    }
}
