package com.huatek.busi.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.huatek.busi.constant.ApiConstant;
import com.huatek.busi.service.gis.GisHomePageService;
import com.huatek.busi.vo.HeaderInfoVo;
import com.huatek.torch.frame.tools.ConstantUtil;
import com.huatek.torch.frame.tools.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author plus_wang
 */

@Api(tags = {ApiConstant.Tags.BUSI_GIS_HOME_PAGE})
@RestController
@RequestMapping("/api/GisHomePage")
public class GisHomePageController {

    protected final Logger logger = LoggerFactory.getLogger(GisHomePageController.class);

    @Reference(check = false)
    private GisHomePageService gisHomePageService;

    /**
     * gis首页电流，电压，负荷率信息查询
     *
     * @param id 设备树id
     * @return map map
     */
    @ApiOperation(value = "首页电流，电压，负荷率信息查询")
    @GetMapping(value = "/getHeaderInfo/{id}", produces = {"application/json;charset=utf-8"})
    public Map<String, Object> getHeaderInfo(@PathVariable(value = "id") String id) {
        HeaderInfoVo headerInfoVo =
                gisHomePageService.getHeaderInfo(id);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", headerInfoVo);
    }
}
