package com.usky.fire.controller.web;


import com.usky.common.core.bean.ApiResult;
import com.usky.fire.service.BscEnterpriseStreetTownService;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 企业自主管理大屏统计（街镇） 前端控制器
 * </p>
 *
 * @author JCB
 * @since 2022-10-09
 */
@RestController
@RequestMapping("/bscEnterpriseStreetTown")
public class BscEnterpriseStreetTownController {

    @Autowired
    private BscEnterpriseStreetTownService bscEnterpriseStreetTownService;

    /**
     * 企业自主管理大屏统计-街镇数据查询
     *
     * @param moduleType 模块类型
     * @param dataType   数据类型
     * @param streetTown 街镇
     * @return
     */
    @GetMapping("enterpriseStreetTown")
    public ApiResult<Object> enterpriseStreetTown(@RequestParam(value = "dataType") String dataType,
                                                  @RequestParam(value = "moduleType") String moduleType,
                                                  @RequestParam(value = "streetTown") String streetTown) {
        return ApiResult.success(bscEnterpriseStreetTownService.enterpriseStreetTown(moduleType, dataType, streetTown));
    }


    @GetMapping("streetCompany")
    public ApiResult<Void> streetCompany() {
        bscEnterpriseStreetTownService.enterpriseStreetTownTask();
        return ApiResult.success();
    }
}

