package com.usky.fire.controller.web;


import com.usky.common.core.bean.ApiResult;
import com.usky.common.core.bean.CommonPage;
import com.usky.fire.domain.DemFireHazardsNotice;
import com.usky.fire.service.DemFireHazardsNoticeService;
import com.usky.fire.service.ReportIndexResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

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

/**
 * <p>
 * 重大火灾隐患整改通知书 前端控制器
 * </p>
 *
 * @author han
 * @since 2023-08-25
 */
@RestController
@RequestMapping("/demFireHazardsNotice")
public class DemFireHazardsNoticeController {
    @Autowired
    private DemFireHazardsNoticeService demFireHazardsNoticeService;

    /**
     * 挂牌督改-信息查询
     *
     * @param pageNum      当前页
     * @param pageSize     每页条数
     * @return
     */
    @GetMapping("hazardsNoticeList")
    public ApiResult<CommonPage<DemFireHazardsNotice>> hazardsNoticeList(@RequestParam(value = "listingLevel",required = false) Integer listingLevel,
                                                                         @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
                                                                         @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
        return ApiResult.success(demFireHazardsNoticeService.hazardsNoticeList(listingLevel,pageNum, pageSize));
    }

    /**
     * 挂牌督改-统计
     *
     * @return
     */
    @GetMapping("hazardsNoticeStatistic")
    public ApiResult<List<Map<String, Object>>> hazardsNoticeStatistic() {
        return ApiResult.success(demFireHazardsNoticeService.hazardsNoticeStatistic());
    }
}

