【修改继电器属性字段】

This commit is contained in:
weizhihong 2023-10-07 17:51:00 +08:00
parent 5283348f5e
commit a6da86f91d
4 changed files with 214 additions and 181 deletions

View File

@ -289,7 +289,7 @@ func relayOperation(c *gin.Context) {
}
simulation := checkDeviceDataAndReturn(req.SimulationId)
zap.S().Info("传入状态参数", req)
memory.ChangeRelayState(simulation, req.MapId, req.Id, req.td)
memory.ChangeRelayState(simulation, req.MapId, req.Id, req.Td)
c.JSON(http.StatusOK, "ok")
}

View File

@ -2664,58 +2664,6 @@ const docTemplate = `{
}
}
},
"/api/v1/simulation/create": {
"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": "创建仿真请求",
"name": "SimulationCreateReqDto",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SimulationCreateReqDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.SimulationCreateRspDto"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/dto.ErrorDto"
}
}
}
}
},
"/api/v1/simulation/createByProject": {
"post": {
"security": [
@ -2907,14 +2855,14 @@ const docTemplate = `{
}
}
},
"/api/v1/simulation/state/:id": {
"get": {
"/api/v1/simulation/relay/operation": {
"post": {
"security": [
{
"JwtAuth": []
}
],
"description": "创建并进入仿真后获取仿真的设备信息",
"description": "ATS测试-操作继电器",
"consumes": [
"application/json"
],
@ -2924,7 +2872,7 @@ const docTemplate = `{
"tags": [
"ATS测试仿真Api"
],
"summary": "创建并进入仿真后获取仿真的设备信息",
"summary": "获取ATS测试-操作继电器",
"parameters": [
{
"type": "string",
@ -2934,18 +2882,20 @@ const docTemplate = `{
"required": true
},
{
"type": "integer",
"description": "仿真id",
"name": "id",
"in": "path",
"required": true
"description": "ATS测试仿真-操作继电器",
"name": "RelayOperationReqDto",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.RelayOperationReqDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.SimulationCreateRspDto"
"type": "string"
}
},
"500": {
@ -4438,6 +4388,10 @@ const docTemplate = `{
"description": "物理区段、道岔ID",
"type": "string"
},
"mapId": {
"description": "场景ID",
"type": "integer"
},
"simulationId": {
"description": "仿真id",
"type": "string"
@ -4455,6 +4409,10 @@ const docTemplate = `{
"dto.AddTrainRspDto": {
"type": "object",
"properties": {
"mapId": {
"description": "场景ID",
"type": "integer"
},
"simulationId": {
"description": "仿真id",
"type": "string"
@ -4527,7 +4485,10 @@ const docTemplate = `{
"code": {
"type": "integer"
},
"message": {
"detail": {
"type": "string"
},
"title": {
"type": "string"
}
}
@ -4629,6 +4590,9 @@ const docTemplate = `{
},
"name": {
"type": "string"
},
"type": {
"type": "integer"
}
}
},
@ -4656,9 +4620,35 @@ const docTemplate = `{
}
}
},
"dto.RelayOperationReqDto": {
"type": "object",
"required": [
"id",
"mapId",
"simulationId"
],
"properties": {
"id": {
"type": "string"
},
"mapId": {
"type": "integer"
},
"simulationId": {
"type": "string"
},
"td": {
"type": "boolean"
}
}
},
"dto.RemoveTrainDto": {
"type": "object",
"properties": {
"mapId": {
"description": "场景ID",
"type": "integer"
},
"simulationId": {
"description": "仿真id",
"type": "string"
@ -4689,6 +4679,13 @@ const docTemplate = `{
"description": "地图id",
"type": "integer"
},
"mapIds": {
"description": "地图列表",
"type": "array",
"items": {
"type": "integer"
}
},
"projectId": {
"description": "项目ID",
"type": "integer"
@ -4705,6 +4702,12 @@ const docTemplate = `{
"mapId": {
"type": "integer"
},
"mapIds": {
"type": "array",
"items": {
"type": "integer"
}
},
"projectId": {
"type": "integer"
},
@ -4716,14 +4719,18 @@ const docTemplate = `{
"dto.SwitchOperationReqDto": {
"type": "object",
"required": [
"simulationId",
"switchIndex"
"id",
"mapId",
"simulationId"
],
"properties": {
"simulationId": {
"id": {
"type": "string"
},
"switchIndex": {
"mapId": {
"type": "integer"
},
"simulationId": {
"type": "string"
},
"turnNormal": {
@ -4964,6 +4971,10 @@ const docTemplate = `{
"description": "显示状态",
"type": "integer"
},
"type": {
"description": "数据类型",
"type": "integer"
},
"user_id": {
"description": "发布用户id",
"type": "integer"

View File

@ -2657,58 +2657,6 @@
}
}
},
"/api/v1/simulation/create": {
"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": "创建仿真请求",
"name": "SimulationCreateReqDto",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.SimulationCreateReqDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.SimulationCreateRspDto"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/dto.ErrorDto"
}
}
}
}
},
"/api/v1/simulation/createByProject": {
"post": {
"security": [
@ -2900,14 +2848,14 @@
}
}
},
"/api/v1/simulation/state/:id": {
"get": {
"/api/v1/simulation/relay/operation": {
"post": {
"security": [
{
"JwtAuth": []
}
],
"description": "创建并进入仿真后获取仿真的设备信息",
"description": "ATS测试-操作继电器",
"consumes": [
"application/json"
],
@ -2917,7 +2865,7 @@
"tags": [
"ATS测试仿真Api"
],
"summary": "创建并进入仿真后获取仿真的设备信息",
"summary": "获取ATS测试-操作继电器",
"parameters": [
{
"type": "string",
@ -2927,18 +2875,20 @@
"required": true
},
{
"type": "integer",
"description": "仿真id",
"name": "id",
"in": "path",
"required": true
"description": "ATS测试仿真-操作继电器",
"name": "RelayOperationReqDto",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.RelayOperationReqDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.SimulationCreateRspDto"
"type": "string"
}
},
"500": {
@ -4431,6 +4381,10 @@
"description": "物理区段、道岔ID",
"type": "string"
},
"mapId": {
"description": "场景ID",
"type": "integer"
},
"simulationId": {
"description": "仿真id",
"type": "string"
@ -4448,6 +4402,10 @@
"dto.AddTrainRspDto": {
"type": "object",
"properties": {
"mapId": {
"description": "场景ID",
"type": "integer"
},
"simulationId": {
"description": "仿真id",
"type": "string"
@ -4520,7 +4478,10 @@
"code": {
"type": "integer"
},
"message": {
"detail": {
"type": "string"
},
"title": {
"type": "string"
}
}
@ -4622,6 +4583,9 @@
},
"name": {
"type": "string"
},
"type": {
"type": "integer"
}
}
},
@ -4649,9 +4613,35 @@
}
}
},
"dto.RelayOperationReqDto": {
"type": "object",
"required": [
"id",
"mapId",
"simulationId"
],
"properties": {
"id": {
"type": "string"
},
"mapId": {
"type": "integer"
},
"simulationId": {
"type": "string"
},
"td": {
"type": "boolean"
}
}
},
"dto.RemoveTrainDto": {
"type": "object",
"properties": {
"mapId": {
"description": "场景ID",
"type": "integer"
},
"simulationId": {
"description": "仿真id",
"type": "string"
@ -4682,6 +4672,13 @@
"description": "地图id",
"type": "integer"
},
"mapIds": {
"description": "地图列表",
"type": "array",
"items": {
"type": "integer"
}
},
"projectId": {
"description": "项目ID",
"type": "integer"
@ -4698,6 +4695,12 @@
"mapId": {
"type": "integer"
},
"mapIds": {
"type": "array",
"items": {
"type": "integer"
}
},
"projectId": {
"type": "integer"
},
@ -4709,14 +4712,18 @@
"dto.SwitchOperationReqDto": {
"type": "object",
"required": [
"simulationId",
"switchIndex"
"id",
"mapId",
"simulationId"
],
"properties": {
"simulationId": {
"id": {
"type": "string"
},
"switchIndex": {
"mapId": {
"type": "integer"
},
"simulationId": {
"type": "string"
},
"turnNormal": {
@ -4957,6 +4964,10 @@
"description": "显示状态",
"type": "integer"
},
"type": {
"description": "数据类型",
"type": "integer"
},
"user_id": {
"description": "发布用户id",
"type": "integer"

View File

@ -17,6 +17,9 @@ definitions:
id:
description: 物理区段、道岔ID
type: string
mapId:
description: 场景ID
type: integer
simulationId:
description: 仿真id
type: string
@ -29,6 +32,9 @@ definitions:
type: object
dto.AddTrainRspDto:
properties:
mapId:
description: 场景ID
type: integer
simulationId:
description: 仿真id
type: string
@ -76,7 +82,9 @@ definitions:
properties:
code:
type: integer
message:
detail:
type: string
title:
type: string
type: object
dto.LoginDto:
@ -147,6 +155,8 @@ definitions:
type: integer
name:
type: string
type:
type: integer
type: object
dto.RegisterUser:
properties:
@ -165,8 +175,26 @@ definitions:
description: 注册时间
type: string
type: object
dto.RelayOperationReqDto:
properties:
id:
type: string
mapId:
type: integer
simulationId:
type: string
td:
type: boolean
required:
- id
- mapId
- simulationId
type: object
dto.RemoveTrainDto:
properties:
mapId:
description: 场景ID
type: integer
simulationId:
description: 仿真id
type: string
@ -188,6 +216,11 @@ definitions:
mapId:
description: 地图id
type: integer
mapIds:
description: 地图列表
items:
type: integer
type: array
projectId:
description: 项目ID
type: integer
@ -199,6 +232,10 @@ definitions:
properties:
mapId:
type: integer
mapIds:
items:
type: integer
type: array
projectId:
type: integer
simulationId:
@ -206,17 +243,20 @@ definitions:
type: object
dto.SwitchOperationReqDto:
properties:
simulationId:
id:
type: string
switchIndex:
mapId:
type: integer
simulationId:
type: string
turnNormal:
type: boolean
turnReverse:
type: boolean
required:
- id
- mapId
- simulationId
- switchIndex
type: object
dto.TokenRespDto:
properties:
@ -382,6 +422,9 @@ definitions:
status:
description: 显示状态
type: integer
type:
description: 数据类型
type: integer
user_id:
description: 发布用户id
type: integer
@ -2133,39 +2176,6 @@ paths:
summary: ATS测试仿真地图数据校验
tags:
- ATS测试仿真Api
/api/v1/simulation/create:
post:
consumes:
- application/json
description: 创建ATS测试仿真
parameters:
- description: JWT Token
in: header
name: Authorization
required: true
type: string
- description: 创建仿真请求
in: body
name: SimulationCreateReqDto
required: true
schema:
$ref: '#/definitions/dto.SimulationCreateReqDto'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.SimulationCreateRspDto'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/dto.ErrorDto'
security:
- JwtAuth: []
summary: 创建ATS测试仿真
tags:
- ATS测试仿真Api
/api/v1/simulation/createByProject:
post:
consumes:
@ -2287,36 +2297,37 @@ paths:
summary: 获取ATS测试系统所有仿真实例的基本信息
tags:
- ATS测试仿真Api
/api/v1/simulation/state/:id:
get:
/api/v1/simulation/relay/operation:
post:
consumes:
- application/json
description: 创建并进入仿真后获取仿真的设备信息
description: ATS测试-操作继电器
parameters:
- description: JWT Token
in: header
name: Authorization
required: true
type: string
- description: 仿真id
in: path
name: id
- description: ATS测试仿真-操作继电器
in: body
name: RelayOperationReqDto
required: true
type: integer
schema:
$ref: '#/definitions/dto.RelayOperationReqDto'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.SimulationCreateRspDto'
type: string
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/dto.ErrorDto'
security:
- JwtAuth: []
summary: 创建并进入仿真后获取仿真的设备信息
summary: 获取ATS测试-操作继电器
tags:
- ATS测试仿真Api
/api/v1/simulation/switch/operation: