2025-11-03 17:35:03 +08:00
|
|
|
// Package network define struct of network operation
|
|
|
|
|
package network
|
|
|
|
|
|
|
|
|
|
// RealTimeQueryRequest define struct of real time data query request
|
|
|
|
|
type RealTimeQueryRequest struct {
|
|
|
|
|
// required: true
|
|
|
|
|
// enum: [start, stop]
|
|
|
|
|
Action string `json:"action" example:"start" description:"请求的操作,例如 start/stop"`
|
|
|
|
|
// TODO 增加monitorID的example值说明
|
2025-11-26 17:49:24 +08:00
|
|
|
ClientID string `json:"client_id" example:"xxxx" description:"用于标识不同client的监控请求ID"`
|
2025-11-03 17:35:03 +08:00
|
|
|
|
|
|
|
|
// required: true
|
2025-11-26 17:49:24 +08:00
|
|
|
Measurements []RealTimeMeasurementItem `json:"measurements" description:"定义不同的数据采集策略和目标"`
|
2025-11-03 17:35:03 +08:00
|
|
|
}
|
|
|
|
|
|
2025-11-06 17:22:14 +08:00
|
|
|
// RealTimeSubRequest define struct of real time data subscription request
|
|
|
|
|
type RealTimeSubRequest struct {
|
|
|
|
|
// required: true
|
|
|
|
|
// enum: [start, stop]
|
2025-11-08 17:11:07 +08:00
|
|
|
Action string `json:"action" example:"start" description:"请求的操作,例如 start/stop"`
|
|
|
|
|
ClientID string `json:"client_id" example:"5d72f2d9-e33a-4f1b-9c76-88a44b9a953e" description:"用于标识不同client的监控请求ID"`
|
2025-11-06 17:22:14 +08:00
|
|
|
// required: true
|
2025-11-26 17:49:24 +08:00
|
|
|
Measurements []RealTimeMeasurementItem `json:"measurements" description:"定义不同的数据采集策略和目标"`
|
2025-11-06 17:22:14 +08:00
|
|
|
}
|
|
|
|
|
|
2025-11-26 17:49:24 +08:00
|
|
|
// RealTimeMeasurementItem define struct of real time measurement item
|
|
|
|
|
type RealTimeMeasurementItem struct {
|
2025-11-03 17:35:03 +08:00
|
|
|
Interval string `json:"interval" example:"1" description:"数据采集的时间间隔(秒)"`
|
2025-12-02 17:26:15 +08:00
|
|
|
Targets []string `json:"targets" example:"[\"grid1.zone1.station1.ns1.tag1.bay.I11_A_rms\",\"grid1.zone1.station1.ns1.tag1.tag1.bay.I11_B_rms\"]" description:"需要采集数据的测点或标签名称列表"`
|
2025-11-03 17:35:03 +08:00
|
|
|
}
|
2025-11-11 11:50:25 +08:00
|
|
|
|
|
|
|
|
// RealTimePullPayload define struct of pull real time data payload
|
|
|
|
|
type RealTimePullPayload struct {
|
|
|
|
|
// required: true
|
2025-12-02 17:26:15 +08:00
|
|
|
Targets []RealTimePullTarget `json:"targets" example:"{\"targets\":[{\"id\":\"grid1.zone1.station1.ns1.tag1.bay.I11_A_rms\",\"datas\":[{\"time\":1736305467506000000,\"value\":1},{\"time\":1736305467506000000,\"value\":1}]},{\"id\":\"grid1.zone1.station1.ns1.tag1.bay.I11_B_rms\",\"datas\":[{\"time\":1736305467506000000,\"value\":1},{\"time\":1736305467506000000,\"value\":1}]}]}" description:"实时数据"`
|
2025-11-11 11:50:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// RealTimePullTarget define struct of pull real time data target
|
|
|
|
|
type RealTimePullTarget struct {
|
2025-12-02 17:26:15 +08:00
|
|
|
ID string `json:"id" example:"grid1.zone1.station1.ns1.tag1.bay.I11_A_rms" description:"实时数据ID值"`
|
2025-11-11 11:50:25 +08:00
|
|
|
Datas []RealTimePullData `json:"datas" example:"[{\"time\":1736305467506000000,\"value\":220},{\"time\":1736305467506000000,\"value\":220}]" description:"实时数据值数组"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// RealTimePullData define struct of pull real time data param
|
|
|
|
|
type RealTimePullData struct {
|
|
|
|
|
Time string `json:"time" example:"1736305467506000000" description:"实时数据时间戳"`
|
|
|
|
|
Value float64 `json:"value" example:"220" description:"实时数据值"`
|
|
|
|
|
}
|