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.BusiSubPageService;
import com.huatek.busi.vo.warning.BusiPdVo;
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/08/20
 */
@Api(tags = {Tags.PD_WARNNING_THRESHOLD})
@RestController
@RequestMapping("/app/pdWarnningAndThreshold")
public class PdWarnningAndThresholdController {
    @Reference(check = false)
    private BusiSubPageService busiSubPageService;

    /**
     * @Title: getPdWarningInfo
     * @Description: 局放告警信息
     * @createDate: Aug 2, 2019 2:22:03 PM
     * @param    warningId    告警ID
     * @param    sensorCode   传感器编码
     * @return   Map<String,Object>
     */
    @ApiOperation(value = "局放告警信息", response = BusiPdVo.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "warningId", value="告警ID"),
            @ApiImplicitParam(name = "sensorCode", value="传感器编码"),
            @ApiImplicitParam(name = "pdType", value="局放类型 1-变压器  2-GIS 3-电缆")
    })
    @GetMapping(value = "/getPdWarningInfo")
    public Map<String, Object> getPdWarningInfo(@RequestParam("warningId") String warningId,
                                                @RequestParam("sensorCode") String sensorCode, @RequestParam("pdType") String pdType) {
        BusiPdVo vo = busiSubPageService.getPdWarningInfo(warningId, sensorCode, pdType);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", vo);
    }
}
