rts-sim-testing-service/dto/simulation.go
2023-08-25 10:41:13 +08:00

80 lines
2.5 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package dto
// 创建仿真请求
type SimulationCreateReqDto struct {
//地图id
MapId int32 `json:"mapId" form:"mapId"`
}
// 创建仿真响应
type SimulationCreateRspDto struct {
//地图id
MapId int32 `json:"mapId" form:"mapId"`
//仿真id
SimulationId string `json:"simulationId" form:"simulationId"`
}
//////////////////////////////////////////////////////////////////////////////
// 为仿真添加测试车请求
type AddTrainReqDto struct {
//仿真id
SimulationId string `json:"simulationId" form:"simulationId"`
//列车方向,true-上行false-下行
RunDirection bool `json:"up" form:"up"`
//车头所在link的索引
HeadLinkId string `json:"headLinkId" form:"headLinkId"`
//车头所在link内的偏移量单位为mm
HeadLinkOffset int64 `json:"headLinkOffset" form:"headLinkOffset"`
//物理区段、道岔ID
Id string `json:"id" form:"id"`
//道岔端口
DevicePort string `json:"devicePort" form:"devicePort"`
//车头所在link内的偏移量单位为mm
HeadOffset int64 `json:"headOffset" form:"headOffset"`
//列车长度
TrainLength int64 `json:"trainLength" from:"trainLength"`
}
// 为仿真添加测试车请求
type AddTrainRspDto struct {
//仿真id
SimulationId string `json:"simulationId" form:"simulationId"`
//新添加的列车的索引
TrainId string `json:"trainId" form:"trainId"`
}
/////////////////////////////////////////////////////////////////////////////////
// 仿真移除列车请求
type RemoveTrainDto AddTrainRspDto
/////////////////////////////////////////////////////////////////////////////////
type SwitchOperationReqDto struct {
SimulationId string `form:"simulationId" json:"simulationId" binding:"required"`
SwitchIndex string `form:"switchIndex" json:"switchIndex" binding:"required"`
TurnNormal bool `form:"turnNormal" json:"turnNormal"`
TurnReverse bool `form:"turnReverse" json:"turnReverse"`
}
/////////////////////////////////////////////////////////////////////////////////
// 地铁数据检测请求
type CheckMapDataReqDto struct {
Data []byte `form:"data" json:"data" binding:"required"`
}
// 地图检验数据响应
type CheckMapDataRspDto struct {
Success bool `form:"success" json:"success"`
Errors []string `form:"errors" json:"errors"`
}
// 仿真实例的基本信息响应
type SimulationInfoRepDto struct {
SimulationId string `form:"simulationId" json:"simulationId"`
MapId string `form:"mapId" json:"mapId"`
}
type SimulationInfoRepDtoArr []SimulationInfoRepDto