2024-11-27 15:41:22 +08:00
|
|
|
// Package network define struct of network operation
|
|
|
|
|
package network
|
|
|
|
|
|
2025-10-20 15:06:23 +08:00
|
|
|
// FailureResponse define struct of standard failure API response format
|
2024-12-06 16:13:11 +08:00
|
|
|
type FailureResponse struct {
|
2025-10-20 17:30:55 +08:00
|
|
|
Code int `json:"code" example:"500"`
|
|
|
|
|
Msg string `json:"msg" example:"failed to get recommend data from redis"`
|
|
|
|
|
PayLoad any `json:"payload" swaggertype:"object"`
|
2024-11-27 15:41:22 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-20 15:06:23 +08:00
|
|
|
// SuccessResponse define struct of standard successful API response format
|
2024-12-06 16:13:11 +08:00
|
|
|
type SuccessResponse struct {
|
2025-10-20 17:30:55 +08:00
|
|
|
Code int `json:"code" example:"200"`
|
|
|
|
|
Msg string `json:"msg" example:"success"`
|
|
|
|
|
PayLoad any `json:"payload" swaggertype:"object"`
|
2024-11-27 15:41:22 +08:00
|
|
|
}
|
2025-10-20 15:06:23 +08:00
|
|
|
|
|
|
|
|
// MeasurementRecommendPayload define struct of represents the data payload for the successful recommendation response.
|
|
|
|
|
type MeasurementRecommendPayload struct {
|
|
|
|
|
Input string `json:"input" example:"transformfeeder1_220."`
|
2025-10-20 17:30:55 +08:00
|
|
|
Offset int `json:"offset" example:"21"`
|
|
|
|
|
RecommendedList []string `json:"recommended_list" example:"[\"I_A_rms\", \"I_B_rms\",\"I_C_rms\"]"`
|
2025-10-20 15:06:23 +08:00
|
|
|
}
|
2025-11-04 17:12:15 +08:00
|
|
|
|
2025-11-06 17:22:14 +08:00
|
|
|
// TargetResult define struct of target item in real time data subscription response payload
|
2025-11-05 18:20:54 +08:00
|
|
|
type TargetResult struct {
|
2025-11-04 17:12:15 +08:00
|
|
|
ID string `json:"id" example:"grid1.zone1.station1.ns1.tag1.transformfeeder1_220.I_A_rms"`
|
|
|
|
|
Code string `json:"code" example:"1001"`
|
|
|
|
|
Msg string `json:"msg" example:"subscription success"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-06 17:22:14 +08:00
|
|
|
// RealTimeSubPayload define struct of real time data subscription request
|
|
|
|
|
type RealTimeSubPayload struct {
|
2025-11-08 17:11:07 +08:00
|
|
|
ClientID string `json:"monitor_id" example:"5d72f2d9-e33a-4f1b-9c76-88a44b9a953e" description:"用于标识不同client的监控请求ID"`
|
2025-11-05 18:20:54 +08:00
|
|
|
TargetResults []TargetResult `json:"targets"`
|
2025-11-04 17:12:15 +08:00
|
|
|
}
|