Authored by qinchao

新接口:通用指标上报

... ... @@ -8,6 +8,8 @@ import com.ui.http.HttpRestClient;
import com.ui.model.BaseResponse;
import com.ui.model.MonitAlarmInfo;
import com.ui.model.WebHooksReleaseBO;
import com.ui.model.alarm.CommonAlarmData;
import com.ui.model.alarm.CommonData;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.NumberUtils;
... ... @@ -39,6 +41,17 @@ public class OuterIntfCtrl {
private HttpRestClient httpClient;
/**
* 对外接口,通用指标上报
*/
@RequestMapping("/commonAlarmDataUpLoad")
@ResponseBody
public void commonAlarmDataUpLoad(@RequestBody CommonData<CommonAlarmData> data){
BaseResponse baseResponse=httpClient.defaultPost("/commonAlarmData/upLoadData",data,BaseResponse.class);
System.out.println(baseResponse);
}
/**
* 对外接口,提供报警
* @param info
* @return
... ...
package com.ui.model.alarm;
/**
* Created by hui.xu on 2017/5/5.
*/
import lombok.Data;
@Data
public class CommonAlarmData {
/**
* 设备类型
*/
private String deviceType;
/**
* 系统名称
*/
private String sysName;
/**
* 系统模块名称
*/
private String sysModule;
/**
* 上报的类型,枚举类型
* success
* error
* 后续再加
*/
private String upLoadType;
/**
* 上报的内容
*/
private String upLoadContent;
/**
* 数值
*/
private Integer upLoadValue;
/**
* 保留策略,枚举类型
* 1d
* 7d
* 后续再加
*/
private String duration;
}
\ No newline at end of file
... ...
package com.ui.model.alarm;
import lombok.Data;
/**
* Created by hui.xu on 2017/5/5.
*/
@Data
public class CommonData<T> {
private String code;
private T data;
}
... ...
... ... @@ -328,7 +328,7 @@
checkType='radio';
checkTypeCss='rdio rdio-default';
}
if(data==null){
return ;
}
... ... @@ -358,6 +358,7 @@
//加载环境
function loadEnv(projName){
$("#environmentDiv_node").html("");
$.ajax({
url: contextPath+'nodeBuild/getProject?name=' + projName,
type: 'POST',
... ... @@ -377,12 +378,16 @@
if (i % 4 == 0) {
node_env_HTML += "</br>";
}
var show_label=env.name;
if(env.name=='az2'){
show_label=env.name+'(灰度)';
}
node_env_HTML += "<div class='ckbox ckbox-primary' style='display: inline'>";
node_env_HTML += " <input name='environment' type='checkbox' id='node_env_" + env.name + "' value='" + env.name +"' ";
node_env_HTML += "/>";
node_env_HTML += "<label for='node_env_" + env.name + "' style='width: 200px'>" + env.name + "</label></div>";
node_env_HTML += "<label for='node_env_" + env.name + "' style='width: 200px'>" + show_label + "</label></div>";
}
$("#select-environment-div").append(node_env_HTML);
$("#environmentDiv_node").append(node_env_HTML);
},
error: function (e) {
alert("获取项目环境失败");
... ...