package com.ruoyi.gysl.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.gysl.entity.BasicInformation;
import com.ruoyi.gysl.service.BasicInformationService;
import com.ruoyi.gysl.service.ZwStatsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
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;

/**
 * 政务统计控制层
 *
 * @author makejava
 * @since 2025-02-24 09:25:51
 */
@Api(tags = "政务统计")
@RestController
@RequestMapping("/gysl/zwStats")
@PreAuthorize("@ss.hasAnyRoles('admin,common')")
public class ZwStatsController extends BaseController {

    @Resource
    private ZwStatsService zwStatsService;

    @Resource
    private BasicInformationService basicInformationService;

    /**
     * 项目情况
     */
    @ApiOperation("整体项目情况")
    @GetMapping("/allProject")
    public AjaxResult allProject() {
        return success(zwStatsService.allProject());
    }

    /**
     * 功能区
     */
    @ApiOperation("功能区")
    @GetMapping("/ribbon")
    public AjaxResult ribbon() {
        return success(zwStatsService.ribbon());
    }

    /**
     * 投资主体
     */
    @ApiOperation("投资主体")
    @GetMapping("/investors")
    public AjaxResult investors() {
        return success(zwStatsService.investors());
    }

    /**
     * 有经纬度的项目列表
     */
    @ApiOperation("有经纬度的项目列表")
    @GetMapping("/projectList")
    public AjaxResult projectList(Page<BasicInformation> page) {
        return success(basicInformationService.projectList(page));
    }

    /**
     * 消息通知
     */
    @ApiOperation("消息通知")
    @GetMapping("/zwNotice")
    public AjaxResult zwNotice() {
        return success(zwStatsService.zwNotice());
    }


    /**
     * 政务消息通知数量
     */
    @ApiOperation("政务消息通知数量")
    @GetMapping("/zwNoticeCount")
    public AjaxResult zwNoticeCount() {
        return success(zwStatsService.zwNoticeCount());
    }
}

