package com.changhu.module.superManagement.controller;

import com.baomidou.mybatisplus.extension.toolkit.Db;
import com.changhu.common.annotation.JsonBody;
import com.changhu.module.superManagement.pojo.vo.EnterprisesUnitServiceProjectSecurityUserTotalVo;
import com.changhu.module.superManagement.service.SuperIndexService;
import com.changhu.pojo.entity.EnterprisesUnit;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 20252
 * @createTime 2024/11/21 上午11:31
 * @desc SuperIndexController...
 */
@JsonBody
@Tag(name = "超级后台-首页")
@RequestMapping("/m1/index")
@RestController
public class SuperIndexController {

    @Autowired
    private SuperIndexService superIndexService;

    @Operation(summary = "企事业单位地图点位")
    @GetMapping("/points")
    public List<EnterprisesUnit> points() {
        return Db.lambdaQuery(EnterprisesUnit.class).list();
    }

    @Operation(summary = "统计事业单位 服务项目及保安人数")
    @GetMapping("/statistics")
    public EnterprisesUnitServiceProjectSecurityUserTotalVo statistics() {
        return superIndexService.statistics();
    }

}
