package com.huatek.busi.controller;

import java.util.Map;

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;

import com.alibaba.dubbo.config.annotation.Reference;
import com.huatek.busi.constant.ApiConstant.Tags;
import com.huatek.busi.service.MeteorologicalService;
import com.huatek.busi.vo.MeteorologicalVo;
import com.huatek.torch.frame.tools.ConstantUtil;
import com.huatek.torch.frame.tools.ResultUtil;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

/**
 * 气象数据
 * 
 * @author buck_guo
 * @date 2019/09/21
 */
@Api(tags = {Tags.METEOROLOGICAL})
@RestController
@RequestMapping("/api/Meteorological")
public class MeteorologicalControlloer {
    @Reference(check = false)
    private MeteorologicalService meteorologicalService;
    
    @ApiOperation(value = "获取气象信息", response = MeteorologicalVo.class)
    @ApiImplicitParams({
        @ApiImplicitParam(name = "sensorCode", value = "sensor编码"),
        @ApiImplicitParam(name = "equipmentType", value = "设备类型")
    })
    @GetMapping(value = "/queryMeteorologicalInfo/info", produces = {"application/json;charset=utf-8"})
    public Map<String, Object> queryMeteorologicalInfo(@RequestParam("sensorCode") String sensorCode,
        @RequestParam("equipmentType") String equipmentType) {
        MeteorologicalVo  meteorologicalVo =
            meteorologicalService.queryMeteorologicalInfo(sensorCode, equipmentType);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", meteorologicalVo);
    }
}
