171 lines
5.6 KiB
JSON
171 lines
5.6 KiB
JSON
{
|
||
"swagger": "2.0",
|
||
"info": {
|
||
"description": "实时数据计算和模型运行服务的 API 服务",
|
||
"title": "ModelRT 实时模型服务 API 文档",
|
||
"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"
|
||
},
|
||
"version": "1.0"
|
||
},
|
||
"host": "localhost:8080",
|
||
"basePath": "/api/v1",
|
||
"paths": {
|
||
"/api/v1/recommend/measurement": {
|
||
"post": {
|
||
"description": "根据用户输入的字符串,从 Redis 中查询可能的测量点或结构路径,并提供推荐列表。",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Recommend"
|
||
],
|
||
"summary": "测量点推荐(搜索框自动补全)",
|
||
"parameters": [
|
||
{
|
||
"description": "查询输入参数,例如 'trans' 或 'grid_key.'",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/network.MeasurementRecommendRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "请求或查询失败。**注意**:HTTP 状态码始终为 200,但内部 Code 为 400 (参数错误) 或 500 (内部错误)。",
|
||
"schema": {
|
||
"$ref": "#/definitions/network.FailureResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/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": {
|
||
"network.FailureResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"code": {
|
||
"type": "integer",
|
||
"example": 500
|
||
},
|
||
"msg": {
|
||
"type": "string",
|
||
"example": "failed to get recommend data from redis"
|
||
},
|
||
"payload": {
|
||
"type": "object",
|
||
"additionalProperties": {
|
||
"type": "string"
|
||
},
|
||
"example": {
|
||
"key": "value"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"network.MeasurementRecommendPayload": {
|
||
"type": "object",
|
||
"properties": {
|
||
"input": {
|
||
"type": "string",
|
||
"example": "transformfeeder1_220."
|
||
},
|
||
"offset": {
|
||
"type": "integer",
|
||
"example": 20
|
||
},
|
||
"recommended_list": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"example": [
|
||
"[\"I_A_rms\"",
|
||
" \"I_B_rms\"]"
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"network.MeasurementRecommendRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"input": {
|
||
"type": "string",
|
||
"example": "trans"
|
||
}
|
||
}
|
||
},
|
||
"network.SuccessResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"code": {
|
||
"type": "integer",
|
||
"example": 200
|
||
},
|
||
"msg": {
|
||
"type": "string",
|
||
"example": "success"
|
||
},
|
||
"payload": {
|
||
"type": "object",
|
||
"additionalProperties": {
|
||
"type": "string"
|
||
},
|
||
"example": {
|
||
"key": "value"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
} |