package com.ruoyi.web.controller.visual;


import com.ruoyi.system.domain.*;
import com.ruoyi.common.core.domain.Result;
import com.ruoyi.system.dto.VisitingWebsiteRankingDTO;
import com.ruoyi.system.dto.WebSiteTenDaysHitsDTO;
import com.ruoyi.system.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/webSite/")
public class VisualController {

    @Autowired
    private IWebsiteAvailabilityMonitorService websiteAvailabilityMonitorService;
    @Autowired
    private IUnableToAccessWebsiteListTodayService unableToAccessWebsiteListTodayService;
    @Autowired
    private IWebSiteTenDaysHitsService webSiteTenDaysHitsService;
    @Autowired
    private IVisitingWebsiteRankingService visitingWebsiteRankingService;
    @Autowired
    private IColumnPageViewService columnPageViewService;
    @Autowired
    private IPopularInformationService popularInformationService;
    @Autowired
    private IMunicipalMisprintService municipalMisprintService;
    @Autowired
    private ICountyAndDistrictMisprintService countyAndDistrictMisprintService;
    @Autowired
    private IMunicipalErrorLinkMonitorService municipalErrorLinkMonitorService;
    @Autowired
    private ICensusElementsService censusElementsService;
    @Autowired
    private ICensusItemNegativeInformationService censusItemNegativeInformationService;
    @Autowired
    private IDailyTrafficRankingService dailyTrafficRankingService;
    @Autowired
    private IDailyUpdateRankingService dailyUpdateRankingService;
    @Autowired
    private ICountyDailyTrafficRankingService countyDailyTrafficRankingService;
    @Autowired
    private ICountyDailyUpdateRankingService countyDailyUpdateRankingService;
    @Autowired
    private IMunicipalInteractiveColumnsService municipalInteractiveColumnsService;
    @Autowired
    private IAreaInteractiveColumnsService areaInteractiveColumnsService;
    @Autowired
    private ICountyInteractiveColumnsService countyInteractiveColumnsService;


    /**
     * 网站可用性实时监测-数据推送接口
     */
    @PostMapping("putWebsiteAvailabilityMonitor")
    @ResponseBody
    public Result<?> insertBatchWebsiteAvailabilityMonitor(@RequestBody List<WebsiteAvailabilityMonitor> list) {
        websiteAvailabilityMonitorService.insertBatch(list);
        return Result.ok();
    }

    /**
     * 本日无法访问网站列表-数据推送接口
     */
    @PostMapping("putUnableToAccessWebsiteListToday")
    @ResponseBody
    public Result<?> insertBatchUnableToAccessWebsiteListToday(List<UnableToAccessWebsiteListToday> list) {
        unableToAccessWebsiteListTodayService.insertBatch(list);
        return Result.ok();
    }

    /**
     * 市政府网站十日内点击量-数据推送接口
     */
    @PostMapping("putWebSiteTenDaysHits")
    @ResponseBody
    public Result<?> insertBatchWebSiteTenDaysHits(WebSiteTenDaysHitsDTO dto) {
        webSiteTenDaysHitsService.insertBatch(dto);
        return Result.ok();
    }

    /**
     * 市政府门户网站访问情况监测-全国各省访问吉林市政府网站排名-数据推送接口
     */
    @PostMapping("putVisitingWebsiteRanking")
    @ResponseBody
    public Result<?> insertBatchVisitingWebsiteRanking(VisitingWebsiteRankingDTO dto) {
        visitingWebsiteRankingService.insertBatch(dto);
        return Result.ok();
    }

    /**
     * 市政府门户网站访问情况监测-门户网站栏目浏览量-数据推送接口
     */
    @PostMapping("putColumnPageView")
    @ResponseBody
    public Result<?> insertColumnPageView(List<ColumnPageView> list) {
        columnPageViewService.insertBatch(list);
        return Result.ok();
    }

    /**
     * 市政府门户网站访问情况监测-每日最受欢迎信息排名-数据推送接口
     */
    @PostMapping("putPopularInformation")
    @ResponseBody
    public Result<?> insertPopularInformation(List<PopularInformation> list) {
        popularInformationService.insertBatch(list);
        return Result.ok();
    }

    /**
     * 市政府门户网站错别字监测-市政府工作部门-数据推送接口
     */
    @PostMapping("putMunicipalMisprint")
    @ResponseBody
    public Result<?> insertMunicipalMisprint(List<MunicipalMisprint> list) {
        municipalMisprintService.insertBatch(list);
        return Result.ok();
    }

    /**
     * 市政府门户网站错别字监测-县(市)区政府-数据推送接口
     */
    @PostMapping("putCountyAndDistrictMisprint")
    @ResponseBody
    public Result<?> insertCountyAndDistrictMisprint(List<CountyAndDistrictMisprint> list) {
        countyAndDistrictMisprintService.insertBatch(list);
        return Result.ok();
    }

    /**
     * 市政府门户网站错误链接监测-市政府门户网站错误链接监测-数据推送接口
     */
    @PostMapping("putMunicipalErrorLinkMonitor")
    @ResponseBody
    public Result<?> insertMunicipalErrorLinkMonitor(List<MunicipalErrorLinkMonitor> list) {
        municipalErrorLinkMonitorService.insertBatch(list);
        return Result.ok();
    }

    /**
     * 网站普查指标监测-网站普查要素-数据推送接口
     */
    @PostMapping("putCensusElements")
    @ResponseBody
    public Result<?> insertCensusElements(List<CensusElements> list) {
        censusElementsService.insertBatch(list);
        return Result.ok();
    }

    /**
     * 网站普查指标监测-网站普查单项否信息-数据推送接口
     */
    @PostMapping("putCensusItemNegativeInformation")
    @ResponseBody
    public Result<?> insertCensusItemNegativeInformation(List<CensusItemNegativeInformation> list) {
        censusItemNegativeInformationService.insertBatch(list);
        return Result.ok();
    }

    /**
     * 市直部门日更新访问量排名-市直部门日访问量排名-数据推送接口
     */
    @PostMapping("putDailyTrafficRanking")
    @ResponseBody
    public Result<?> insertDailyTrafficRanking(List<DailyTrafficRanking> list) {
        dailyTrafficRankingService.insertBatch(list);
        return Result.ok();
    }

    /**
     * 市直部门日更新访问量排名-市直部门日更新量排名-数据推送接口
     */
    @PostMapping("putDailyUpdateRanking")
    @ResponseBody
    public Result<?> insertDailyUpdateRanking(List<DailyUpdateRanking> list) {
        dailyUpdateRankingService.insertBatch(list);
        return Result.ok();
    }

    /**
     * 县(市)区政府日更新访问量排名-县(市)区政府日访问量排名-数据推送接口
     */
    @PostMapping("putCountyDailyTrafficRanking")
    @ResponseBody
    public Result<?> insertCountyDailyTrafficRanking(List<CountyDailyTrafficRanking> list) {
        countyDailyTrafficRankingService.insertBatch(list);
        return Result.ok();
    }

    /**
     * 县（市）区政府日更新访问量排名 - 县（市）区政府日更新量排名-数据推送接口
     */
    @PostMapping("putCountyDailyUpdateRanking")
    @ResponseBody
    public Result<?> insertCountyDailyUpdateRanking(List<CountyDailyUpdateRanking> list) {
        countyDailyUpdateRankingService.insertBatch(list);
        return Result.ok();
    }

    /**
     * 市政府网站群互动类栏目更新情况-市直部门-数据推送接口
     */
    @PostMapping("putMunicipalInteractiveColumns")
    @ResponseBody
    public Result<?> insertMunicipalInteractiveColumns(List<MunicipalInteractiveColumns> list) {
        municipalInteractiveColumnsService.insertBatch(list);
        return Result.ok();
    }

    /**
     * 市政府网站群互动类栏目更新情况-区、开发区-数据推送接口
     */
    @PostMapping("putAreaInteractiveColumns")
    @ResponseBody
    public Result<?> insertAreaInteractiveColumns(List<AreaInteractiveColumns> list) {
        areaInteractiveColumnsService.insertBatch(list);
        return Result.ok();
    }

    /**
     * 市政府网站群互动类栏目更新情况告警展示-县（市）-数据推送接口
     */
    @PostMapping("putCountyInteractiveColumns")
    @ResponseBody
    public Result<?> insertCountyInteractiveColumns(List<CountyInteractiveColumns> list) {
        countyInteractiveColumnsService.insertBatch(list);
        return Result.ok();
    }

    /**
     * 网站可用性实时监测
     */
    @GetMapping("/listWebsiteAvailabilityMonitor")
    public List<WebsiteAvailabilityMonitor> selectWebsiteAvailabilityMonitorList() {
        return websiteAvailabilityMonitorService.selectWebsiteAvailabilityMonitorList();
    }

    /**
     * 本日无法访问网站列表
     */
    @GetMapping("/listUnableToAccessWebsiteListToday")
    public List<UnableToAccessWebsiteListToday> selectUnableToAccessWebsiteListTodayList() {
        return unableToAccessWebsiteListTodayService.selectUnableToAccessWebsiteListTodayList();
    }

    /**
     * 市政府网站十日内点击量
     */
    @GetMapping("/listWebSiteTenDaysHits")
    public Map<String, List<String>> selectWebSiteTenDaysHitsList() {
        return webSiteTenDaysHitsService.selectWebSiteTenDaysHitsList();
    }

    /**
     * 全国各省访问吉林市政府网站排名
     */
    @GetMapping("/listVisitingWebsiteRanking")
    public Map<String, List<String>> selectVisitingWebsiteRankingList() {
        return visitingWebsiteRankingService.selectVisitingWebsiteRankingList();
    }
    /**
     * 门户网站栏目浏览量
     */
    @GetMapping("/listColumnPageView")
    public List<ColumnPageView> selectColumnPageViewList() {
        return columnPageViewService.selectColumnPageViewList();
    }
    /**
     * 每日最受欢迎信息排名
     */
    @GetMapping("/listPopularInformation")
    public List<PopularInformation> selectPopularInformationList() {
        return popularInformationService.selectPopularInformationList();
    }

    /**
     * 市政府门户网站错别字监测-市政府工作部门
     */
    @GetMapping("/listMunicipalMisprint")
    public List<MunicipalMisprint> selectMunicipalMisprintList() {
        return municipalMisprintService.selectMunicipalMisprintList();
    }

    /**
     * 市政府门户网站错别字监测-县(市)区政府
     */
    @GetMapping("/listCountyAndDistrictMisprint")
    public List<CountyAndDistrictMisprint> selectCountyAndDistrictMisprintList() {
        return countyAndDistrictMisprintService.selectCountyAndDistrictMisprintList();
    }

    /**
     * 市政府门户网站错误链接监测
     */
    @GetMapping("/listMunicipalErrorLinkMonitor")
    public List<MunicipalErrorLinkMonitor> selectMunicipalErrorLinkMonitorList() {
        return municipalErrorLinkMonitorService.selectMunicipalErrorLinkMonitorList();
    }

    /**
     * 网站普查要素
     */
    @GetMapping("/listCensusElements")
    public List<CensusElements> selectCensusElementsList() {
        return censusElementsService.selectCensusElementsList();
    }

    /**
     * 网站普查单项否信息
     */
    @GetMapping("/listCensusItemNegativeInformation")
    public List<CensusItemNegativeInformation> selectCensusItemNegativeInformationList() {
        return censusItemNegativeInformationService.selectCensusItemNegativeInformationList();
    }

    /**
     * 市直部门日访问量排名
     */
    @GetMapping("/listDailyTrafficRanking")
    public List<DailyTrafficRanking> selectDailyTrafficRankingList() {
        return dailyTrafficRankingService.selectDailyTrafficRankingList();
    }

    /**
     * 市直部门日更新量排名
     */
    @GetMapping("/listDailyUpdateRanking")
    public List<DailyUpdateRanking> selectDailyUpdateRankingList() {
        return dailyUpdateRankingService.selectDailyUpdateRankingList();
    }

    /**
     * 县(市)区政府日访问量排名
     */
    @GetMapping("/listCountyDailyTrafficRanking")
    public List<CountyDailyTrafficRanking> selectCountyDailyTrafficRankingList() {
        return countyDailyTrafficRankingService.selectCountyDailyTrafficRankingList();
    }

    /**
     * 县（市）区政府日更新量排名
     */
    @GetMapping("/listCountyDailyUpdateRanking")
    public List<CountyDailyUpdateRanking> selectCountyDailyUpdateRankingList() {
        return countyDailyUpdateRankingService.selectCountyDailyUpdateRankingList();
    }

    /**
     * 市政府网站群互动类栏目更新情况-市直部门
     */
    @GetMapping("/listMunicipalInteractiveColumns")
    public List<MunicipalInteractiveColumns> selectMunicipalInteractiveColumnsList() {
        return municipalInteractiveColumnsService.selectMunicipalInteractiveColumnsList();
    }

    /**
     * 市政府网站群互动类栏目更新情况-区、开发区
     */
    @GetMapping("/listAreaInteractiveColumns")
    public List<AreaInteractiveColumns> selectAreaInteractiveColumnsList() {
        return areaInteractiveColumnsService.selectAreaInteractiveColumnsList();
    }

    /**
     * 市政府网站群互动类栏目更新情况告警展示-县（市）
     */
    @GetMapping("/listCountyInteractiveColumns")
    public List<CountyInteractiveColumns> selectCountyInteractiveColumnsList() {
        return countyInteractiveColumnsService.selectCountyInteractiveColumnsList();
    }


}
