package com.changhu.module.miniProgram.controller;

import com.changhu.common.annotation.CheckUserType;
import com.changhu.common.annotation.JsonBody;
import com.changhu.common.db.enums.UserType;
import com.changhu.common.pojo.vo.SelectNodeVo;
import com.changhu.module.miniProgram.pojo.vo.IndexDataStatisticsVo;
import com.changhu.module.miniProgram.pojo.vo.IndexServiceProjectListVo;
import com.changhu.module.miniProgram.service.MPoliceService;
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 java.util.List;

/**
 * @author 20252
 * @createTime 2024/9/11 上午10:44
 * @desc PoliceIndexController...
 */
@Tag(name = "公安人员首页")
@JsonBody
@RequestMapping("/policeIndex")
public class PoliceIndexController {

    @Autowired
    private MPoliceService policeIndexService;

    @Operation(summary = "首页数据统计")
    @GetMapping("/dataStatistics")
    @CheckUserType(userTypes = UserType.MINI_PROGRAM_POLICE)
    public IndexDataStatisticsVo dataStatistics() {
        return policeIndexService.dataStatistics();
    }

    @Operation(summary = "获取单位内的服务项目")
    @GetMapping("/getUnitServiceProjectList")
    @CheckUserType(userTypes = UserType.MINI_PROGRAM_POLICE)
    public List<IndexServiceProjectListVo> getUnitServiceProjectList() {
        return policeIndexService.getUnitServiceProjectList();
    }

    @Operation(summary = "获取单位内的企事业单位列表")
    @GetMapping("/getUnitEnterprisesUnitList")
    @CheckUserType(userTypes = UserType.MINI_PROGRAM_POLICE)
    public List<SelectNodeVo<Long>> getUnitEnterprisesUnitList() {
        return policeIndexService.getUnitEnterprisesUnitList();
    }
}
