modelRT/docs/docs.go

276 lines
9.4 KiB
Go
Raw Normal View History

2024-12-06 16:13:11 +08:00
// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
2025-10-20 15:06:23 +08:00
"contact": {
"name": "douxu",
"url": "http://www.swagger.io/support",
"email": "douxu@clea.com.cn"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
2024-12-06 16:13:11 +08:00
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
2025-10-27 16:47:04 +08:00
"/data/realtime": {
"get": {
"description": "根据用户输入的组件token,从 dataRT 服务中持续获取测点实时数据",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"RealTime Component"
],
"summary": "获取实时测点数据",
"parameters": [
{
"type": "string",
"description": "测量点唯一标识符 (e.g.grid_1:zone_1:station_1:transformfeeder1_220.I_A_rms)",
"name": "token",
"in": "query",
"required": true
},
{
"type": "integer",
"description": "查询起始时间 (Unix时间戳, e.g., 1761008266)",
"name": "begin",
"in": "query",
"required": true
},
{
"type": "integer",
"description": "查询结束时间 (Unix时间戳, e.g., 1761526675)",
"name": "end",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "返回实时数据成功",
"schema": {
"allOf": [
{
"$ref": "#/definitions/network.SuccessResponse"
},
{
"type": "object",
"properties": {
"payload": {
"$ref": "#/definitions/network.RealTimeDataPayload"
}
}
}
]
}
},
"400": {
"description": "返回实时数据失败",
"schema": {
"$ref": "#/definitions/network.FailureResponse"
}
}
}
}
},
"/measurement/recommend": {
"get": {
2025-10-20 15:06:23 +08:00
"description": "根据用户输入的字符串,从 Redis 中查询可能的测量点或结构路径,并提供推荐列表。",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Measurement Recommend"
2025-10-20 15:06:23 +08:00
],
"summary": "测量点推荐(搜索框自动补全)",
"parameters": [
{
"description": "查询输入参数,例如 'trans' 或 'transformfeeder1_220.'",
2025-10-20 15:06:23 +08:00
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/network.MeasurementRecommendRequest"
}
}
],
"responses": {
"200": {
"description": "返回推荐列表成功",
"schema": {
"allOf": [
{
"$ref": "#/definitions/network.SuccessResponse"
},
{
"type": "object",
"properties": {
"payload": {
"$ref": "#/definitions/network.MeasurementRecommendPayload"
}
}
}
]
}
},
"400": {
"description": "返回推荐列表失败",
2025-10-20 15:06:23 +08:00
"schema": {
"$ref": "#/definitions/network.FailureResponse"
}
}
}
}
},
2024-12-06 16:13:11 +08:00
"/model/diagram_load/{page_id}": {
"get": {
"description": "load circuit diagram info by page id",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"load circuit_diagram"
],
"summary": "load circuit diagram info",
"parameters": [
{
"type": "integer",
"description": "page ID",
"name": "page_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "request process success",
"schema": {
"$ref": "#/definitions/network.SuccessResponse"
}
},
"400": {
"description": "request process failed",
"schema": {
"$ref": "#/definitions/network.FailureResponse"
}
}
}
}
}
},
"definitions": {
2025-10-20 15:06:23 +08:00
"network.FailureResponse": {
2024-12-06 16:13:11 +08:00
"type": "object",
"properties": {
2025-10-20 15:06:23 +08:00
"code": {
2024-12-06 16:13:11 +08:00
"type": "integer",
2025-10-20 15:06:23 +08:00
"example": 500
},
"msg": {
"type": "string",
"example": "failed to get recommend data from redis"
},
"payload": {
"type": "object"
2024-12-06 16:13:11 +08:00
}
}
},
2025-10-20 15:06:23 +08:00
"network.MeasurementRecommendPayload": {
2024-12-06 16:13:11 +08:00
"type": "object",
"properties": {
2025-10-20 15:06:23 +08:00
"input": {
"type": "string",
"example": "transformfeeder1_220."
2024-12-06 16:13:11 +08:00
},
2025-10-20 15:06:23 +08:00
"offset": {
"type": "integer",
"example": 21
2025-10-20 15:06:23 +08:00
},
"recommended_list": {
"type": "array",
"items": {
"type": "string"
},
"example": [
"[\"I_A_rms\"",
" \"I_B_rms\"",
"\"I_C_rms\"]"
2025-10-20 15:06:23 +08:00
]
}
}
},
"network.MeasurementRecommendRequest": {
"type": "object",
"properties": {
"input": {
"type": "string",
"example": "trans"
2024-12-06 16:13:11 +08:00
}
}
2025-10-27 16:47:04 +08:00
},
"network.RealTimeDataPayload": {
"type": "object",
"properties": {
"sub_pos": {
"description": "TODO 增加example tag",
"type": "object"
}
}
2024-12-06 16:13:11 +08:00
},
"network.SuccessResponse": {
"type": "object",
"properties": {
2025-10-20 15:06:23 +08:00
"code": {
"type": "integer",
"example": 200
},
"msg": {
"type": "string",
"example": "success"
2024-12-06 16:13:11 +08:00
},
"payload": {
"type": "object"
2024-12-06 16:13:11 +08:00
}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
2025-10-20 15:06:23 +08:00
Version: "1.0",
Host: "localhost:8080",
BasePath: "/api/v1",
2024-12-06 16:13:11 +08:00
Schemes: []string{},
2025-10-20 15:06:23 +08:00
Title: "ModelRT 实时模型服务 API 文档",
Description: "实时数据计算和模型运行服务的 API 服务",
2024-12-06 16:13:11 +08:00
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}