修改道岔操作接口API

This commit is contained in:
walker 2023-10-16 09:05:37 +08:00
parent 702a77b82a
commit 7138c78734
6 changed files with 518 additions and 147 deletions

View File

@ -229,7 +229,7 @@ func removeTrain(c *gin.Context) {
// @Accept json
// @Produce json
// @Param Authorization header string true "JWT Token"
// @Param RemoveTrainDto body dto.SwitchOperationReqDto true "ATS测试仿真-操作道岔"
// @Param TurnoutOperationReq body request_proto.TurnoutOperationReq true "ATS测试仿真-操作道岔"
//
// @Success 200 {object} string
// @Failure 500 {object} dto.ErrorDto

@ -1 +1 @@
Subproject commit f43d8dbec4b997ef729ceb6e086db1bd066c0790
Subproject commit c18ac281a6360f6ceceb1df93c86dc888879fe46

View File

@ -1235,13 +1235,15 @@ const docTemplate = `{
"enum": [
0,
1,
2
2,
3
],
"type": "integer",
"x-enum-varnames": [
"PictureType_StationLayout",
"PictureType_Psl",
"PictureType_RelayCabinetLayout"
"PictureType_RelayCabinetLayout",
"PictureType_IBP"
],
"name": "type",
"in": "query"
@ -1333,7 +1335,7 @@ const docTemplate = `{
"JwtAuth": []
}
],
"description": "可以通过草稿名称过滤,分页查询草稿",
"description": "可以通过草稿类型过滤,列表查询草稿",
"consumes": [
"application/json"
],
@ -1343,28 +1345,12 @@ const docTemplate = `{
"tags": [
"草稿Api"
],
"summary": "分页查询草稿",
"summary": "列表查询草稿",
"parameters": [
{
"type": "string",
"name": "name",
"type": "integer",
"name": "type",
"in": "query"
},
{
"type": "integer",
"example": 1,
"description": "页码",
"name": "current",
"in": "query",
"required": true
},
{
"type": "integer",
"example": 10,
"description": "页面行数",
"name": "size",
"in": "query",
"required": true
}
],
"responses": {
@ -1502,13 +1488,15 @@ const docTemplate = `{
"enum": [
0,
1,
2
2,
3
],
"type": "integer",
"x-enum-varnames": [
"PictureType_StationLayout",
"PictureType_Psl",
"PictureType_RelayCabinetLayout"
"PictureType_RelayCabinetLayout",
"PictureType_IBP"
],
"name": "type",
"in": "query"
@ -1643,13 +1631,15 @@ const docTemplate = `{
"enum": [
0,
1,
2
2,
3
],
"type": "integer",
"x-enum-varnames": [
"PictureType_StationLayout",
"PictureType_Psl",
"PictureType_RelayCabinetLayout"
"PictureType_RelayCabinetLayout",
"PictureType_IBP"
],
"name": "type",
"in": "query"
@ -2297,6 +2287,11 @@ const docTemplate = `{
],
"summary": "列表查询发布的图形数据",
"parameters": [
{
"type": "string",
"name": "category",
"in": "query"
},
{
"type": "string",
"name": "name",
@ -2306,6 +2301,11 @@ const docTemplate = `{
"type": "string",
"name": "time",
"in": "query"
},
{
"type": "integer",
"name": "type",
"in": "query"
}
],
"responses": {
@ -2907,6 +2907,58 @@ const docTemplate = `{
}
}
},
"/api/v1/simulation/signal/operation": {
"post": {
"security": [
{
"JwtAuth": []
}
],
"description": "ATS测试-信号机操作",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"ATS测试仿真Api"
],
"summary": "ATS测试-信号机操作",
"parameters": [
{
"type": "string",
"description": "JWT Token",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "ATS测试仿真-操作信号机",
"name": "SignalOperationReqDto",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SignalOperationReqDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/dto.ErrorDto"
}
}
}
}
},
"/api/v1/simulation/switch/operation": {
"post": {
"security": [
@ -2935,11 +2987,11 @@ const docTemplate = `{
},
{
"description": "ATS测试仿真-操作道岔",
"name": "RemoveTrainDto",
"name": "TurnoutOperationReq",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SwitchOperationReqDto"
"$ref": "#/definitions/request_proto.TurnoutOperationReq"
}
}
],
@ -4659,6 +4711,28 @@ const docTemplate = `{
}
}
},
"dto.SignalOperationReqDto": {
"type": "object",
"required": [
"id",
"mapId",
"simulationId"
],
"properties": {
"aspect": {
"$ref": "#/definitions/state.Signal_Aspect"
},
"id": {
"type": "string"
},
"mapId": {
"type": "integer"
},
"simulationId": {
"type": "string"
}
}
},
"dto.SimulationCreateReqDto": {
"type": "object",
"properties": {
@ -4716,31 +4790,6 @@ const docTemplate = `{
}
}
},
"dto.SwitchOperationReqDto": {
"type": "object",
"required": [
"id",
"mapId",
"simulationId"
],
"properties": {
"id": {
"type": "string"
},
"mapId": {
"type": "integer"
},
"simulationId": {
"type": "string"
},
"turnNormal": {
"type": "boolean"
},
"turnReverse": {
"type": "boolean"
}
}
},
"dto.TokenRespDto": {
"type": "object",
"properties": {
@ -4814,12 +4863,14 @@ const docTemplate = `{
"enum": [
0,
1,
2
2,
3
],
"x-enum-varnames": [
"PictureType_StationLayout",
"PictureType_Psl",
"PictureType_RelayCabinetLayout"
"PictureType_RelayCabinetLayout",
"PictureType_IBP"
]
},
"model.AuthAPIPath": {
@ -5057,6 +5108,90 @@ const docTemplate = `{
"type": "string"
}
}
},
"request_proto.TurnoutOperationReq": {
"type": "object",
"properties": {
"deviceId": {
"description": "设备id",
"type": "string"
},
"mapId": {
"description": "图id",
"type": "integer"
},
"operation": {
"description": "道岔操作",
"allOf": [
{
"$ref": "#/definitions/request_proto.Turnout_Operation"
}
]
},
"simulationId": {
"description": "仿真id",
"type": "string"
}
}
},
"request_proto.Turnout_Operation": {
"type": "integer",
"enum": [
0,
1,
2,
3,
4,
5,
6,
7,
8
],
"x-enum-comments": {
"Turnout_CancelDC": "取消定操",
"Turnout_CancelFC": "取消反操",
"Turnout_CancelJC": "取消挤岔故障",
"Turnout_CancelSB": "取消失表故障",
"Turnout_DC": "定操",
"Turnout_FC": "反操",
"Turnout_SetJC": "设置挤岔故障",
"Turnout_SetSB": "设置失表故障",
"Turnout_Undefined": "未定义"
},
"x-enum-varnames": [
"Turnout_Undefined",
"Turnout_DC",
"Turnout_CancelDC",
"Turnout_FC",
"Turnout_CancelFC",
"Turnout_SetSB",
"Turnout_CancelSB",
"Turnout_SetJC",
"Turnout_CancelJC"
]
},
"state.Signal_Aspect": {
"type": "integer",
"enum": [
0,
1,
2,
3,
4,
5,
6,
7
],
"x-enum-varnames": [
"Signal_OFF",
"Signal_ON",
"Signal_L",
"Signal_H",
"Signal_U",
"Signal_HU",
"Signal_B",
"Signal_A"
]
}
},
"securityDefinitions": {

View File

@ -1228,13 +1228,15 @@
"enum": [
0,
1,
2
2,
3
],
"type": "integer",
"x-enum-varnames": [
"PictureType_StationLayout",
"PictureType_Psl",
"PictureType_RelayCabinetLayout"
"PictureType_RelayCabinetLayout",
"PictureType_IBP"
],
"name": "type",
"in": "query"
@ -1326,7 +1328,7 @@
"JwtAuth": []
}
],
"description": "可以通过草稿名称过滤,分页查询草稿",
"description": "可以通过草稿类型过滤,列表查询草稿",
"consumes": [
"application/json"
],
@ -1336,28 +1338,12 @@
"tags": [
"草稿Api"
],
"summary": "分页查询草稿",
"summary": "列表查询草稿",
"parameters": [
{
"type": "string",
"name": "name",
"type": "integer",
"name": "type",
"in": "query"
},
{
"type": "integer",
"example": 1,
"description": "页码",
"name": "current",
"in": "query",
"required": true
},
{
"type": "integer",
"example": 10,
"description": "页面行数",
"name": "size",
"in": "query",
"required": true
}
],
"responses": {
@ -1495,13 +1481,15 @@
"enum": [
0,
1,
2
2,
3
],
"type": "integer",
"x-enum-varnames": [
"PictureType_StationLayout",
"PictureType_Psl",
"PictureType_RelayCabinetLayout"
"PictureType_RelayCabinetLayout",
"PictureType_IBP"
],
"name": "type",
"in": "query"
@ -1636,13 +1624,15 @@
"enum": [
0,
1,
2
2,
3
],
"type": "integer",
"x-enum-varnames": [
"PictureType_StationLayout",
"PictureType_Psl",
"PictureType_RelayCabinetLayout"
"PictureType_RelayCabinetLayout",
"PictureType_IBP"
],
"name": "type",
"in": "query"
@ -2290,6 +2280,11 @@
],
"summary": "列表查询发布的图形数据",
"parameters": [
{
"type": "string",
"name": "category",
"in": "query"
},
{
"type": "string",
"name": "name",
@ -2299,6 +2294,11 @@
"type": "string",
"name": "time",
"in": "query"
},
{
"type": "integer",
"name": "type",
"in": "query"
}
],
"responses": {
@ -2900,6 +2900,58 @@
}
}
},
"/api/v1/simulation/signal/operation": {
"post": {
"security": [
{
"JwtAuth": []
}
],
"description": "ATS测试-信号机操作",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"ATS测试仿真Api"
],
"summary": "ATS测试-信号机操作",
"parameters": [
{
"type": "string",
"description": "JWT Token",
"name": "Authorization",
"in": "header",
"required": true
},
{
"description": "ATS测试仿真-操作信号机",
"name": "SignalOperationReqDto",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SignalOperationReqDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/dto.ErrorDto"
}
}
}
}
},
"/api/v1/simulation/switch/operation": {
"post": {
"security": [
@ -2928,11 +2980,11 @@
},
{
"description": "ATS测试仿真-操作道岔",
"name": "RemoveTrainDto",
"name": "TurnoutOperationReq",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SwitchOperationReqDto"
"$ref": "#/definitions/request_proto.TurnoutOperationReq"
}
}
],
@ -4652,6 +4704,28 @@
}
}
},
"dto.SignalOperationReqDto": {
"type": "object",
"required": [
"id",
"mapId",
"simulationId"
],
"properties": {
"aspect": {
"$ref": "#/definitions/state.Signal_Aspect"
},
"id": {
"type": "string"
},
"mapId": {
"type": "integer"
},
"simulationId": {
"type": "string"
}
}
},
"dto.SimulationCreateReqDto": {
"type": "object",
"properties": {
@ -4709,31 +4783,6 @@
}
}
},
"dto.SwitchOperationReqDto": {
"type": "object",
"required": [
"id",
"mapId",
"simulationId"
],
"properties": {
"id": {
"type": "string"
},
"mapId": {
"type": "integer"
},
"simulationId": {
"type": "string"
},
"turnNormal": {
"type": "boolean"
},
"turnReverse": {
"type": "boolean"
}
}
},
"dto.TokenRespDto": {
"type": "object",
"properties": {
@ -4807,12 +4856,14 @@
"enum": [
0,
1,
2
2,
3
],
"x-enum-varnames": [
"PictureType_StationLayout",
"PictureType_Psl",
"PictureType_RelayCabinetLayout"
"PictureType_RelayCabinetLayout",
"PictureType_IBP"
]
},
"model.AuthAPIPath": {
@ -5050,6 +5101,90 @@
"type": "string"
}
}
},
"request_proto.TurnoutOperationReq": {
"type": "object",
"properties": {
"deviceId": {
"description": "设备id",
"type": "string"
},
"mapId": {
"description": "图id",
"type": "integer"
},
"operation": {
"description": "道岔操作",
"allOf": [
{
"$ref": "#/definitions/request_proto.Turnout_Operation"
}
]
},
"simulationId": {
"description": "仿真id",
"type": "string"
}
}
},
"request_proto.Turnout_Operation": {
"type": "integer",
"enum": [
0,
1,
2,
3,
4,
5,
6,
7,
8
],
"x-enum-comments": {
"Turnout_CancelDC": "取消定操",
"Turnout_CancelFC": "取消反操",
"Turnout_CancelJC": "取消挤岔故障",
"Turnout_CancelSB": "取消失表故障",
"Turnout_DC": "定操",
"Turnout_FC": "反操",
"Turnout_SetJC": "设置挤岔故障",
"Turnout_SetSB": "设置失表故障",
"Turnout_Undefined": "未定义"
},
"x-enum-varnames": [
"Turnout_Undefined",
"Turnout_DC",
"Turnout_CancelDC",
"Turnout_FC",
"Turnout_CancelFC",
"Turnout_SetSB",
"Turnout_CancelSB",
"Turnout_SetJC",
"Turnout_CancelJC"
]
},
"state.Signal_Aspect": {
"type": "integer",
"enum": [
0,
1,
2,
3,
4,
5,
6,
7
],
"x-enum-varnames": [
"Signal_OFF",
"Signal_ON",
"Signal_L",
"Signal_H",
"Signal_U",
"Signal_HU",
"Signal_B",
"Signal_A"
]
}
},
"securityDefinitions": {

View File

@ -202,6 +202,21 @@ definitions:
description: 新添加的列车的索引
type: string
type: object
dto.SignalOperationReqDto:
properties:
aspect:
$ref: '#/definitions/state.Signal_Aspect'
id:
type: string
mapId:
type: integer
simulationId:
type: string
required:
- id
- mapId
- simulationId
type: object
dto.SimulationCreateReqDto:
properties:
mapId:
@ -241,23 +256,6 @@ definitions:
simulationId:
type: string
type: object
dto.SwitchOperationReqDto:
properties:
id:
type: string
mapId:
type: integer
simulationId:
type: string
turnNormal:
type: boolean
turnReverse:
type: boolean
required:
- id
- mapId
- simulationId
type: object
dto.TokenRespDto:
properties:
code:
@ -309,11 +307,13 @@ definitions:
- 0
- 1
- 2
- 3
type: integer
x-enum-varnames:
- PictureType_StationLayout
- PictureType_Psl
- PictureType_RelayCabinetLayout
- PictureType_IBP
model.AuthAPIPath:
properties:
id:
@ -484,6 +484,74 @@ definitions:
description: 名称
type: string
type: object
request_proto.Turnout_Operation:
enum:
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
type: integer
x-enum-comments:
Turnout_CancelDC: 取消定操
Turnout_CancelFC: 取消反操
Turnout_CancelJC: 取消挤岔故障
Turnout_CancelSB: 取消失表故障
Turnout_DC: 定操
Turnout_FC: 反操
Turnout_SetJC: 设置挤岔故障
Turnout_SetSB: 设置失表故障
Turnout_Undefined: 未定义
x-enum-varnames:
- Turnout_Undefined
- Turnout_DC
- Turnout_CancelDC
- Turnout_FC
- Turnout_CancelFC
- Turnout_SetSB
- Turnout_CancelSB
- Turnout_SetJC
- Turnout_CancelJC
request_proto.TurnoutOperationReq:
properties:
deviceId:
description: 设备id
type: string
mapId:
description: 图id
type: integer
operation:
allOf:
- $ref: '#/definitions/request_proto.Turnout_Operation'
description: 道岔操作
simulationId:
description: 仿真id
type: string
type: object
state.Signal_Aspect:
enum:
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
type: integer
x-enum-varnames:
- Signal_OFF
- Signal_ON
- Signal_L
- Signal_H
- Signal_U
- Signal_HU
- Signal_B
- Signal_A
host: localhost:9091
info:
contact: {}
@ -1261,6 +1329,7 @@ paths:
- 0
- 1
- 2
- 3
in: query
name: type
type: integer
@ -1268,6 +1337,7 @@ paths:
- PictureType_StationLayout
- PictureType_Psl
- PictureType_RelayCabinetLayout
- PictureType_IBP
produces:
- application/json
responses:
@ -1386,6 +1456,7 @@ paths:
- 0
- 1
- 2
- 3
in: query
name: type
type: integer
@ -1393,6 +1464,7 @@ paths:
- PictureType_StationLayout
- PictureType_Psl
- PictureType_RelayCabinetLayout
- PictureType_IBP
produces:
- application/json
responses:
@ -1445,6 +1517,7 @@ paths:
- 0
- 1
- 2
- 3
in: query
name: type
type: integer
@ -1452,6 +1525,7 @@ paths:
- PictureType_StationLayout
- PictureType_Psl
- PictureType_RelayCabinetLayout
- PictureType_IBP
produces:
- application/json
responses:
@ -1512,22 +1586,10 @@ paths:
get:
consumes:
- application/json
description: 可以通过草稿名称过滤,分页查询草稿
description: 可以通过草稿类型过滤,列表查询草稿
parameters:
- in: query
name: name
type: string
- description: 页码
example: 1
in: query
name: current
required: true
type: integer
- description: 页面行数
example: 10
in: query
name: size
required: true
name: type
type: integer
produces:
- application/json
@ -1550,7 +1612,7 @@ paths:
$ref: '#/definitions/dto.ErrorDto'
security:
- JwtAuth: []
summary: 分页查询草稿
summary: 列表查询草稿
tags:
- 草稿Api
/api/v1/project:
@ -1997,12 +2059,18 @@ paths:
- application/json
description: 可以通过名称过滤
parameters:
- in: query
name: category
type: string
- in: query
name: name
type: string
- in: query
name: time
type: string
- in: query
name: type
type: integer
produces:
- application/json
responses:
@ -2330,6 +2398,39 @@ paths:
summary: 获取ATS测试-操作继电器
tags:
- ATS测试仿真Api
/api/v1/simulation/signal/operation:
post:
consumes:
- application/json
description: ATS测试-信号机操作
parameters:
- description: JWT Token
in: header
name: Authorization
required: true
type: string
- description: ATS测试仿真-操作信号机
in: body
name: SignalOperationReqDto
required: true
schema:
$ref: '#/definitions/dto.SignalOperationReqDto'
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/dto.ErrorDto'
security:
- JwtAuth: []
summary: ATS测试-信号机操作
tags:
- ATS测试仿真Api
/api/v1/simulation/switch/operation:
post:
consumes:
@ -2343,10 +2444,10 @@ paths:
type: string
- description: ATS测试仿真-操作道岔
in: body
name: RemoveTrainDto
name: TurnoutOperationReq
required: true
schema:
$ref: '#/definitions/dto.SwitchOperationReqDto'
$ref: '#/definitions/request_proto.TurnoutOperationReq'
produces:
- application/json
responses:

@ -1 +1 @@
Subproject commit a9c004a0f02ad94e4334a6d910630312554d4ff1
Subproject commit 1babd47d2877b3d2485432c78a92d749290e86dd