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 15:06:23 +08:00
|
|
|
Code int `json:"code" example:"500"`
|
|
|
|
|
Msg string `json:"msg" example:"failed to get recommend data from redis"`
|
2025-01-23 14:56:01 +08:00
|
|
|
PayLoad map[string]interface{} `json:"payload" swaggertype:"object,string" example:"key:value"`
|
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-01-23 14:56:01 +08:00
|
|
|
Code int `json:"code" example:"200"`
|
2025-10-20 15:06:23 +08:00
|
|
|
Msg string `json:"msg" example:"success"`
|
2025-01-23 14:56:01 +08:00
|
|
|
PayLoad map[string]interface{} `json:"payload" swaggertype:"object,string" example:"key:value"`
|
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."`
|
|
|
|
|
Offset int `json:"offset" example:"20"`
|
|
|
|
|
RecommendedList []string `json:"recommended_list" example:"[\"I_A_rms\", \"I_B_rms\"]"`
|
|
|
|
|
}
|