modelRT/docs/swagger.yaml

164 lines
4.4 KiB
YAML

basePath: /api/v1
definitions:
network.FailureResponse:
properties:
code:
example: 500
type: integer
msg:
example: failed to get recommend data from redis
type: string
payload:
type: object
type: object
network.MeasurementRecommendPayload:
properties:
input:
example: transformfeeder1_220.
type: string
offset:
example: 21
type: integer
recommended_list:
example:
- '["I_A_rms"'
- ' "I_B_rms"'
- '"I_C_rms"]'
items:
type: string
type: array
type: object
network.MeasurementRecommendRequest:
properties:
input:
example: trans
type: string
type: object
network.RealTimeDataPayload:
properties:
sub_pos:
description: TODO 增加example tag
type: object
type: object
network.SuccessResponse:
properties:
code:
example: 200
type: integer
msg:
example: success
type: string
payload:
type: object
type: object
host: localhost:8080
info:
contact:
email: douxu@clea.com.cn
name: douxu
url: http://www.swagger.io/support
description: 实时数据计算和模型运行服务的 API 服务
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
title: ModelRT 实时模型服务 API 文档
version: "1.0"
paths:
/data/realtime:
get:
consumes:
- application/json
description: 根据用户输入的组件token,从 dataRT 服务中持续获取测点实时数据
parameters:
- description: 测量点唯一标识符 (e.g.grid_1:zone_1:station_1:transformfeeder1_220.I_A_rms)
in: query
name: token
required: true
type: string
- description: 查询起始时间 (Unix时间戳, e.g., 1761008266)
in: query
name: begin
required: true
type: integer
- description: 查询结束时间 (Unix时间戳, e.g., 1761526675)
in: query
name: end
required: true
type: integer
produces:
- application/json
responses:
"200":
description: 返回实时数据成功
schema:
allOf:
- $ref: '#/definitions/network.SuccessResponse'
- properties:
payload:
$ref: '#/definitions/network.RealTimeDataPayload'
type: object
"400":
description: 返回实时数据失败
schema:
$ref: '#/definitions/network.FailureResponse'
summary: 获取实时测点数据
tags:
- RealTime Component
/measurement/recommend:
get:
consumes:
- application/json
description: 根据用户输入的字符串,从 Redis 中查询可能的测量点或结构路径,并提供推荐列表。
parameters:
- description: 查询输入参数,例如 'trans' 或 'transformfeeder1_220.'
in: body
name: request
required: true
schema:
$ref: '#/definitions/network.MeasurementRecommendRequest'
produces:
- application/json
responses:
"200":
description: 返回推荐列表成功
schema:
allOf:
- $ref: '#/definitions/network.SuccessResponse'
- properties:
payload:
$ref: '#/definitions/network.MeasurementRecommendPayload'
type: object
"400":
description: 返回推荐列表失败
schema:
$ref: '#/definitions/network.FailureResponse'
summary: 测量点推荐(搜索框自动补全)
tags:
- Measurement Recommend
/model/diagram_load/{page_id}:
get:
consumes:
- application/json
description: load circuit diagram info by page id
parameters:
- description: page ID
in: path
name: page_id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: request process success
schema:
$ref: '#/definitions/network.SuccessResponse'
"400":
description: request process failed
schema:
$ref: '#/definitions/network.FailureResponse'
summary: load circuit diagram info
tags:
- load circuit_diagram
swagger: "2.0"