package com.ruoyi.gysl.controller;


import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.gysl.service.QyStatsService;
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/qyStats")
@PreAuthorize("@ss.hasAnyRoles('company')")
public class QyStatsController extends BaseController {

    @Resource
    private QyStatsService qyStatsService;

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

//    /**
//     * 关联项目
//     */
//    @ApiOperation("关联项目")
//    @GetMapping("/relationalProject")
//    public AjaxResult relationalProject() {
//        return success(qyStatsService.relationalProject(SecurityUtils.getUsername()));
//    }

    /**
     * 消息通知
     */
    @ApiOperation("消息通知")
    @GetMapping("/qyNotice")
    public AjaxResult qyNotice() {
        return success(qyStatsService.qyNotice(SecurityUtils.getUsername()));
    }

    /**
     * 企业消息通知数量
     */
    @ApiOperation("企业消息通知数量")
    @GetMapping("/qyNoticeCount")
    public AjaxResult qyNoticeCount() {
        return success(qyStatsService.qyNoticeCount(SecurityUtils.getUsername()));
    }
}

