|
|
@ -9,9 +9,10 @@ import ( |
|
|
"goInOut/dbOperate" |
|
|
"goInOut/dbOperate" |
|
|
"goInOut/monitors" |
|
|
"goInOut/monitors" |
|
|
"goInOut/utils" |
|
|
"goInOut/utils" |
|
|
"gopkg.in/yaml.v3" |
|
|
|
|
|
"log" |
|
|
"log" |
|
|
"time" |
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
"gopkg.in/yaml.v3" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
type consumerHBJCAS struct { |
|
|
type consumerHBJCAS struct { |
|
|
@ -51,6 +52,7 @@ func (the *consumerHBJCAS) InputInitial() error { |
|
|
the.ch = make(chan []adaptors.NeedPush, 200) |
|
|
the.ch = make(chan []adaptors.NeedPush, 200) |
|
|
//数据入口
|
|
|
//数据入口
|
|
|
the.InHttp = &dbOperate.HttpHelper{Url: the.Info.IoConfig.In.Http.Url, Token: ""} |
|
|
the.InHttp = &dbOperate.HttpHelper{Url: the.Info.IoConfig.In.Http.Url, Token: ""} |
|
|
|
|
|
the.InHttp.SetAuth(the.Info.IoConfig.In.Http.Username, the.Info.IoConfig.In.Http.Password) |
|
|
the.monitor = &monitors.CommonMonitor{ |
|
|
the.monitor = &monitors.CommonMonitor{ |
|
|
MonitorHelper: &monitors.MonitorHelper{}, |
|
|
MonitorHelper: &monitors.MonitorHelper{}, |
|
|
} |
|
|
} |
|
|
@ -139,7 +141,8 @@ func (the *consumerHBJCAS) getEs1HourAggData() { |
|
|
for _, factorId := range hourFactorIds { |
|
|
for _, factorId := range hourFactorIds { |
|
|
esQuery := the.getESQueryStrByHour(structId, factorId, start, end) |
|
|
esQuery := the.getESQueryStrByHour(structId, factorId, start, end) |
|
|
auth := map[string]string{"Authorization": "Bear 85a441d4-022b-4613-abba-aaa8e2693bf7"} |
|
|
auth := map[string]string{"Authorization": "Bear 85a441d4-022b-4613-abba-aaa8e2693bf7"} |
|
|
esAggResultStr := the.InHttp.HttpGetWithHeader(esQuery, auth) |
|
|
//esAggResultStr := the.InHttp.HttpGetWithHeader(esQuery, auth)
|
|
|
|
|
|
esAggResultStr := the.InHttp.HttpPostWithAuth(esQuery, auth) |
|
|
|
|
|
|
|
|
adaptor := the.getAdaptor() |
|
|
adaptor := the.getAdaptor() |
|
|
adaptor.PointInfo = the.Info.PointInfo |
|
|
adaptor.PointInfo = the.Info.PointInfo |
|
|
@ -167,7 +170,8 @@ func (the *consumerHBJCAS) getEs10minAggData() { |
|
|
for _, factorId := range factorIds { |
|
|
for _, factorId := range factorIds { |
|
|
esQuery := the.getESQueryStrBy10min(structId, factorId, start, end) |
|
|
esQuery := the.getESQueryStrBy10min(structId, factorId, start, end) |
|
|
auth := map[string]string{"Authorization": "Bear 85a441d4-022b-4613-abba-aaa8e2693bf7"} |
|
|
auth := map[string]string{"Authorization": "Bear 85a441d4-022b-4613-abba-aaa8e2693bf7"} |
|
|
esAggResultStr := the.InHttp.HttpGetWithHeader(esQuery, auth) |
|
|
//esAggResultStr := the.InHttp.HttpGetWithHeader(esQuery, auth)
|
|
|
|
|
|
esAggResultStr := the.InHttp.HttpPostWithAuth(esQuery, auth) |
|
|
|
|
|
|
|
|
adaptor := the.getAdaptor() |
|
|
adaptor := the.getAdaptor() |
|
|
adaptor.PointInfo = the.Info.PointInfo |
|
|
adaptor.PointInfo = the.Info.PointInfo |
|
|
|