package com.usky.fire.controller.web;


import com.usky.common.core.bean.ApiResult;
import com.usky.fire.domain.BaseBuild;
import com.usky.fire.service.BaseDeviceService;
import com.usky.fire.service.vo.BaseDeviceVO;
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;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author JCB
 * @since 2022-08-15
 */
@RestController
@RequestMapping("/baseDevice")
public class BaseDeviceController {
    @Autowired
    private BaseDeviceService baseDeviceService;

    /**
     * 企业自主管理-物联网设备情况统计
     * @return
     */
    @GetMapping("deviceTypeList")
    public ApiResult<BaseDeviceVO> deviceTypeList(){
        return ApiResult.success(baseDeviceService.deviceTypeList());
    }

    /**
     * 企业自主管理-物联网设备情况统计撒点
     * @param deviceTypeCode
     * @return
     */
    @GetMapping("deviceTypeScatter")
    public ApiResult<List<BaseBuild>> deviceTypeScatter(@RequestParam(value = "deviceTypeCode") Integer deviceTypeCode){
        return ApiResult.success(baseDeviceService.deviceTypeScatter(deviceTypeCode));
    }

}

