【IBP钥匙操作】
This commit is contained in:
parent
211e405798
commit
3648e51863
|
@ -35,7 +35,8 @@ func InitSimulationRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddle
|
|||
authed.POST("/relay/operation", relayOperation)
|
||||
authed.POST("/signal/operation", signalOperation)
|
||||
authed.POST("/esbBtn/operation", esbBtnOperation)
|
||||
authed.POST("/ibp/operation", ibpBtnOperation)
|
||||
authed.POST("/ibp/btn/operation", ibpBtnOperation)
|
||||
authed.POST("/ibp/key/operation", ibpKeyOperation)
|
||||
authed.GET("/:id/getMapKilometerRange", getMapKilometerRange)
|
||||
authed.POST("/psl/operation", pslBtnOperation)
|
||||
|
||||
|
@ -292,19 +293,19 @@ func signalOperation(c *gin.Context) {
|
|||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "JWT Token"
|
||||
// @Param ButtonOperationReqDto body dto.ButtonOperationReqDto true "ATS测试仿真-ESB按钮操作"
|
||||
// @Param EsbButtonOperationReqDto body dto.EsbButtonOperationReqDto true "ATS测试仿真-ESB按钮操作"
|
||||
//
|
||||
// @Success 200 {object} string
|
||||
// @Failure 500 {object} dto.ErrorDto
|
||||
// @Router /api/v1/simulation/esbBtn/operation [post]
|
||||
func esbBtnOperation(c *gin.Context) {
|
||||
req := &dto.ButtonOperationReqDto{}
|
||||
req := &dto.EsbButtonOperationReqDto{}
|
||||
if err := c.ShouldBind(&req); err != nil {
|
||||
panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()})
|
||||
}
|
||||
simulation := checkDeviceDataAndReturn(req.SimulationId)
|
||||
slog.Info("传入状态参数", req)
|
||||
memory.ChangeEsbButtonState(simulation, req.MapId, req.ButtonCode, req.Down)
|
||||
memory.ChangeEsbButtonState(simulation, req.MapId, req.Id, req.Down)
|
||||
c.JSON(http.StatusOK, "ok")
|
||||
}
|
||||
|
||||
|
@ -319,19 +320,46 @@ func esbBtnOperation(c *gin.Context) {
|
|||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "JWT Token"
|
||||
// @Param ButtonOperationReqDto body dto.ButtonOperationReqDto true "ATS测试仿真-IBP按钮操作"
|
||||
// @Param IBPButtonOperationReqDto body dto.IBPButtonOperationReqDto true "ATS测试仿真-IBP按钮操作"
|
||||
//
|
||||
// @Success 200 {object} string
|
||||
// @Failure 500 {object} dto.ErrorDto
|
||||
// @Router /api/v1/simulation/ibp/operation [post]
|
||||
// @Router /api/v1/simulation/ibp/btn/operation [post]
|
||||
func ibpBtnOperation(c *gin.Context) {
|
||||
req := &dto.ButtonOperationReqDto{}
|
||||
req := &dto.IBPButtonOperationReqDto{}
|
||||
if err := c.ShouldBind(&req); err != nil {
|
||||
panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()})
|
||||
}
|
||||
simulation := checkDeviceDataAndReturn(req.SimulationId)
|
||||
slog.Info("传入状态参数", req)
|
||||
memory.ChangeIBPButtonState(simulation, req.MapId, req.Station, req.ButtonCode, req.Down)
|
||||
memory.ChangeIBPButtonState(simulation, req.MapId, req.StationId, req.ButtonCode, req.Down)
|
||||
c.JSON(http.StatusOK, "ok")
|
||||
}
|
||||
|
||||
// ATS测试-IBP钥匙操作
|
||||
//
|
||||
// @Summary ATS测试-IBP钥匙操作
|
||||
//
|
||||
// @Security JwtAuth
|
||||
//
|
||||
// @Description ATS测试-IBP钥匙操作
|
||||
// @Tags ATS测试仿真Api
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "JWT Token"
|
||||
// @Param KeyOperationReqDto body dto.KeyOperationReqDto true "ATS测试仿真-IBP钥匙操作"
|
||||
//
|
||||
// @Success 200 {object} string
|
||||
// @Failure 500 {object} dto.ErrorDto
|
||||
// @Router /api/v1/simulation/ibp/key/operation [post]
|
||||
func ibpKeyOperation(c *gin.Context) {
|
||||
req := &dto.KeyOperationReqDto{}
|
||||
if err := c.ShouldBind(&req); err != nil {
|
||||
panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()})
|
||||
}
|
||||
simulation := checkDeviceDataAndReturn(req.SimulationId)
|
||||
slog.Info("传入状态参数", req)
|
||||
memory.ChangeIBPKeyState(simulation, req.MapId, req.StationId, req.KeyCode, req.Gear)
|
||||
c.JSON(http.StatusOK, "ok")
|
||||
}
|
||||
|
||||
|
@ -346,7 +374,7 @@ func ibpBtnOperation(c *gin.Context) {
|
|||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "JWT Token"
|
||||
// @Param ButtonOperationReqDto body dto.ButtonOperationReqDto true "PSL操作"
|
||||
// @Param PslOperationReqDto body dto.PslOperationReqDto true "PSL操作"
|
||||
//
|
||||
// @Success 200 {object} string
|
||||
// @Failure 500 {object} dto.ErrorDto
|
||||
|
|
|
@ -10,8 +10,8 @@ import (
|
|||
)
|
||||
|
||||
// 操作IBP按钮
|
||||
func ChangeIBPButtonState(sim *VerifySimulation, mapId int32, station, btnCode string, pressDown bool) {
|
||||
stationUid := QueryUidByMidAndComId(mapId, station, &graphicData.Station{})
|
||||
func ChangeIBPButtonState(sim *VerifySimulation, mapId int32, stationId, btnCode string, pressDown bool) {
|
||||
stationUid := QueryUidByMidAndComId(mapId, stationId, &graphicData.Station{})
|
||||
if pressDown {
|
||||
fi.PressDownButton(sim.World, stationUid+"_"+btnCode)
|
||||
} else {
|
||||
|
@ -19,48 +19,67 @@ func ChangeIBPButtonState(sim *VerifySimulation, mapId int32, station, btnCode s
|
|||
}
|
||||
}
|
||||
|
||||
// 操作IBP按钮
|
||||
func ChangeIBPKeyState(sim *VerifySimulation, mapId int32, stationId, keyCode string, gear int32) {
|
||||
stationUid := QueryUidByMidAndComId(mapId, stationId, &graphicData.Station{})
|
||||
fi.SwitchKeyGear(sim.World, stationUid+"_"+keyCode, gear)
|
||||
}
|
||||
|
||||
// 获取仿真车站按钮状态,前端推送
|
||||
func GetMapAllIBPState(sim *VerifySimulation, mapId int32, stationId, ibpMapCode string) *state.AllDevicesStatus {
|
||||
status := &state.AllDevicesStatus{
|
||||
ButtonState: []*state.ButtonState{},
|
||||
LightState: []*state.LightState{},
|
||||
AlarmState: []*state.AlarmState{},
|
||||
KeyState: []*state.KeyState{},
|
||||
}
|
||||
stationUid := QueryUidByMidAndComId(mapId, stationId, &graphicData.Station{})
|
||||
ibpStorage := getStorageIBPMapData(ibpMapCode)
|
||||
for _, data := range ibpStorage.IbpButtons {
|
||||
for _, data := range ibpStorage.IbpButtons { // 按钮
|
||||
entry, ok := entity.GetEntityByUid(sim.World, stationUid+"_"+data.Code)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
if entry.HasComponent(component.ButtonTag) { // 按钮
|
||||
if entry.HasComponent(component.ButtonTag) {
|
||||
status.ButtonState = append(status.ButtonState, getIBPButtonState(data.Common.Id, entry))
|
||||
}
|
||||
}
|
||||
for _, data := range ibpStorage.IbpAlarms {
|
||||
for _, data := range ibpStorage.IbpAlarms { // 报警器
|
||||
entry, ok := entity.GetEntityByUid(sim.World, stationUid+"_"+data.Code)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
if entry.HasComponent(component.AlarmTag) { // 报警器
|
||||
if entry.HasComponent(component.AlarmTag) {
|
||||
status.AlarmState = append(status.AlarmState, &state.AlarmState{
|
||||
Id: data.Common.Id,
|
||||
Active: component.BitStateType.Get(entry).Val,
|
||||
})
|
||||
}
|
||||
}
|
||||
for _, data := range ibpStorage.IbpLights {
|
||||
for _, data := range ibpStorage.IbpLights { // 指示灯
|
||||
entry, ok := entity.GetEntityByUid(sim.World, stationUid+"_"+data.Code)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
if entry.HasComponent(component.LightTag) { // 指示灯
|
||||
if entry.HasComponent(component.LightTag) {
|
||||
status.LightState = append(status.LightState, &state.LightState{
|
||||
Id: data.Common.Id,
|
||||
Active: component.BitStateType.Get(entry).Val,
|
||||
})
|
||||
}
|
||||
}
|
||||
for _, data := range ibpStorage.IbpKeys { // 钥匙
|
||||
entry, ok := entity.GetEntityByUid(sim.World, stationUid+"_"+data.Code)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
if entry.HasComponent(component.KeyTag) {
|
||||
status.KeyState = append(status.KeyState, &state.KeyState{
|
||||
Id: data.Common.Id,
|
||||
Gear: component.GearStateType.Get(entry).Val,
|
||||
})
|
||||
}
|
||||
}
|
||||
return status
|
||||
}
|
||||
|
||||
|
|
|
@ -835,16 +835,16 @@ func handlerIBPDeviceToStation(station *proto.Station, repo *proto.Repository, i
|
|||
repo.Buttons = append(repo.Buttons, b)
|
||||
}
|
||||
for _, data := range storage.IbpKeys { // 钥匙
|
||||
b := &proto.Button{
|
||||
Id: station.Id + "_" + data.Code,
|
||||
Code: data.Code,
|
||||
ButtonType: proto.Button_Key_Knob,
|
||||
b := &proto.Key{
|
||||
Id: station.Id + "_" + data.Code,
|
||||
Code: data.Code,
|
||||
Gear: 2,
|
||||
}
|
||||
deviceMap[data.Common.Id] = &proto.ElectronicComponent{
|
||||
Id: b.Id,
|
||||
DeviceType: proto.DeviceType_DeviceType_Button,
|
||||
DeviceType: proto.DeviceType_DeviceType_Key,
|
||||
}
|
||||
repo.Buttons = append(repo.Buttons, b)
|
||||
repo.Keys = append(repo.Keys, b)
|
||||
}
|
||||
for _, data := range storage.IbpAlarms { // 报警器
|
||||
b := &proto.Alarm{
|
||||
|
@ -1074,8 +1074,8 @@ func findTurnoutIds(axleCountingMap map[string]*graphicData.AxleCounting, axleId
|
|||
}
|
||||
|
||||
func initWorldDeviceState(status *VerifyStatus, repo *repository.Repository) {
|
||||
initWorldTurnoutState(status, repo)
|
||||
initWorldPhysicalSectionState(status, repo)
|
||||
// initWorldTurnoutState(status, repo)
|
||||
// initWorldPhysicalSectionState(status, repo)
|
||||
}
|
||||
|
||||
// 初始化道岔状态
|
||||
|
|
284
docs/docs.go
284
docs/docs.go
|
@ -1,4 +1,5 @@
|
|||
// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
||||
// Code generated by swaggo/swag. DO NOT EDIT.
|
||||
|
||||
package docs
|
||||
|
||||
import "github.com/swaggo/swag"
|
||||
|
@ -2735,6 +2736,49 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/:id/getMapKilometerRange": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "获取仿真地图的公里标范围",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "获取仿真地图的公里标范围",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/check/data": {
|
||||
"post": {
|
||||
"security": [
|
||||
|
@ -2917,11 +2961,11 @@ const docTemplate = `{
|
|||
},
|
||||
{
|
||||
"description": "ATS测试仿真-ESB按钮操作",
|
||||
"name": "ButtonOperationReqDto",
|
||||
"name": "EsbButtonOperationReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ButtonOperationReqDto"
|
||||
"$ref": "#/definitions/dto.EsbButtonOperationReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -2984,7 +3028,7 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/ibp/operation": {
|
||||
"/api/v1/simulation/ibp/btn/operation": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
|
@ -3012,11 +3056,115 @@ const docTemplate = `{
|
|||
},
|
||||
{
|
||||
"description": "ATS测试仿真-IBP按钮操作",
|
||||
"name": "ButtonOperationReqDto",
|
||||
"name": "IBPButtonOperationReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ButtonOperationReqDto"
|
||||
"$ref": "#/definitions/dto.IBPButtonOperationReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/ibp/key/operation": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "ATS测试-IBP钥匙操作",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "ATS测试-IBP钥匙操作",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "ATS测试仿真-IBP钥匙操作",
|
||||
"name": "KeyOperationReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.KeyOperationReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/ibp/operation": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "PSL操作",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "PSL操作",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "PSL操作",
|
||||
"name": "PslOperationReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.PslOperationReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -4730,32 +4878,6 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"dto.ButtonOperationReqDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"down",
|
||||
"id",
|
||||
"mapId",
|
||||
"simulationId"
|
||||
],
|
||||
"properties": {
|
||||
"down": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"simulationId": {
|
||||
"type": "string"
|
||||
},
|
||||
"stationCode": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.CheckMapDataReqDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
@ -4798,6 +4920,79 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"dto.EsbButtonOperationReqDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"mapId",
|
||||
"simulationId"
|
||||
],
|
||||
"properties": {
|
||||
"down": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"simulationId": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.IBPButtonOperationReqDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"buttonCode",
|
||||
"mapId",
|
||||
"simulationId",
|
||||
"stationId"
|
||||
],
|
||||
"properties": {
|
||||
"buttonCode": {
|
||||
"type": "string"
|
||||
},
|
||||
"down": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"simulationId": {
|
||||
"type": "string"
|
||||
},
|
||||
"stationId": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.KeyOperationReqDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"mapId",
|
||||
"simulationId",
|
||||
"stationId"
|
||||
],
|
||||
"properties": {
|
||||
"gear": {
|
||||
"type": "integer"
|
||||
},
|
||||
"keyCode": {
|
||||
"type": "string"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"simulationId": {
|
||||
"type": "string"
|
||||
},
|
||||
"stationId": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.LoginDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
@ -4884,6 +5079,31 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"dto.PslOperationReqDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"buttonCode",
|
||||
"mapId",
|
||||
"simulationId"
|
||||
],
|
||||
"properties": {
|
||||
"buttonCode": {
|
||||
"type": "string"
|
||||
},
|
||||
"down": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"gateBoxId": {
|
||||
"type": "string"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"simulationId": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.PublishedGiLinkDto": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -2729,6 +2729,49 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/:id/getMapKilometerRange": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "获取仿真地图的公里标范围",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "获取仿真地图的公里标范围",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/check/data": {
|
||||
"post": {
|
||||
"security": [
|
||||
|
@ -2911,11 +2954,11 @@
|
|||
},
|
||||
{
|
||||
"description": "ATS测试仿真-ESB按钮操作",
|
||||
"name": "ButtonOperationReqDto",
|
||||
"name": "EsbButtonOperationReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ButtonOperationReqDto"
|
||||
"$ref": "#/definitions/dto.EsbButtonOperationReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -2978,7 +3021,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/ibp/operation": {
|
||||
"/api/v1/simulation/ibp/btn/operation": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
|
@ -3006,11 +3049,115 @@
|
|||
},
|
||||
{
|
||||
"description": "ATS测试仿真-IBP按钮操作",
|
||||
"name": "ButtonOperationReqDto",
|
||||
"name": "IBPButtonOperationReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ButtonOperationReqDto"
|
||||
"$ref": "#/definitions/dto.IBPButtonOperationReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/ibp/key/operation": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "ATS测试-IBP钥匙操作",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "ATS测试-IBP钥匙操作",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "ATS测试仿真-IBP钥匙操作",
|
||||
"name": "KeyOperationReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.KeyOperationReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/ibp/operation": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "PSL操作",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "PSL操作",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "PSL操作",
|
||||
"name": "PslOperationReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.PslOperationReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -4724,32 +4871,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"dto.ButtonOperationReqDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"down",
|
||||
"id",
|
||||
"mapId",
|
||||
"simulationId"
|
||||
],
|
||||
"properties": {
|
||||
"down": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"simulationId": {
|
||||
"type": "string"
|
||||
},
|
||||
"stationCode": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.CheckMapDataReqDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
@ -4792,6 +4913,79 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"dto.EsbButtonOperationReqDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"mapId",
|
||||
"simulationId"
|
||||
],
|
||||
"properties": {
|
||||
"down": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"simulationId": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.IBPButtonOperationReqDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"buttonCode",
|
||||
"mapId",
|
||||
"simulationId",
|
||||
"stationId"
|
||||
],
|
||||
"properties": {
|
||||
"buttonCode": {
|
||||
"type": "string"
|
||||
},
|
||||
"down": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"simulationId": {
|
||||
"type": "string"
|
||||
},
|
||||
"stationId": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.KeyOperationReqDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"mapId",
|
||||
"simulationId",
|
||||
"stationId"
|
||||
],
|
||||
"properties": {
|
||||
"gear": {
|
||||
"type": "integer"
|
||||
},
|
||||
"keyCode": {
|
||||
"type": "string"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"simulationId": {
|
||||
"type": "string"
|
||||
},
|
||||
"stationId": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.LoginDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
@ -4878,6 +5072,31 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"dto.PslOperationReqDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"buttonCode",
|
||||
"mapId",
|
||||
"simulationId"
|
||||
],
|
||||
"properties": {
|
||||
"buttonCode": {
|
||||
"type": "string"
|
||||
},
|
||||
"down": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"gateBoxId": {
|
||||
"type": "string"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"simulationId": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.PublishedGiLinkDto": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -60,24 +60,6 @@ definitions:
|
|||
name:
|
||||
type: string
|
||||
type: object
|
||||
dto.ButtonOperationReqDto:
|
||||
properties:
|
||||
down:
|
||||
type: boolean
|
||||
id:
|
||||
type: string
|
||||
mapId:
|
||||
type: integer
|
||||
simulationId:
|
||||
type: string
|
||||
stationCode:
|
||||
type: string
|
||||
required:
|
||||
- down
|
||||
- id
|
||||
- mapId
|
||||
- simulationId
|
||||
type: object
|
||||
dto.CheckMapDataReqDto:
|
||||
properties:
|
||||
data:
|
||||
|
@ -105,6 +87,56 @@ definitions:
|
|||
title:
|
||||
type: string
|
||||
type: object
|
||||
dto.EsbButtonOperationReqDto:
|
||||
properties:
|
||||
down:
|
||||
type: boolean
|
||||
id:
|
||||
type: string
|
||||
mapId:
|
||||
type: integer
|
||||
simulationId:
|
||||
type: string
|
||||
required:
|
||||
- id
|
||||
- mapId
|
||||
- simulationId
|
||||
type: object
|
||||
dto.IBPButtonOperationReqDto:
|
||||
properties:
|
||||
buttonCode:
|
||||
type: string
|
||||
down:
|
||||
type: boolean
|
||||
mapId:
|
||||
type: integer
|
||||
simulationId:
|
||||
type: string
|
||||
stationId:
|
||||
type: string
|
||||
required:
|
||||
- buttonCode
|
||||
- mapId
|
||||
- simulationId
|
||||
- stationId
|
||||
type: object
|
||||
dto.KeyOperationReqDto:
|
||||
properties:
|
||||
gear:
|
||||
type: integer
|
||||
keyCode:
|
||||
type: string
|
||||
mapId:
|
||||
type: integer
|
||||
simulationId:
|
||||
type: string
|
||||
stationId:
|
||||
type: string
|
||||
required:
|
||||
- mapId
|
||||
- simulationId
|
||||
- stationId
|
||||
type: object
|
||||
dto.LoginDto:
|
||||
properties:
|
||||
account:
|
||||
|
@ -165,6 +197,23 @@ definitions:
|
|||
$ref: '#/definitions/dto.TrainSizeDto'
|
||||
type: array
|
||||
type: object
|
||||
dto.PslOperationReqDto:
|
||||
properties:
|
||||
buttonCode:
|
||||
type: string
|
||||
down:
|
||||
type: boolean
|
||||
gateBoxId:
|
||||
type: string
|
||||
mapId:
|
||||
type: integer
|
||||
simulationId:
|
||||
type: string
|
||||
required:
|
||||
- buttonCode
|
||||
- mapId
|
||||
- simulationId
|
||||
type: object
|
||||
dto.PublishedGiLinkDto:
|
||||
properties:
|
||||
category:
|
||||
|
@ -2357,6 +2406,33 @@ paths:
|
|||
summary: 从发布数据拉取信息到草稿
|
||||
tags:
|
||||
- 发布的图形数据Api
|
||||
/api/v1/simulation/:id/getMapKilometerRange:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 获取仿真地图的公里标范围
|
||||
parameters:
|
||||
- description: JWT Token
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
type: string
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/dto.ErrorDto'
|
||||
security:
|
||||
- JwtAuth: []
|
||||
summary: 获取仿真地图的公里标范围
|
||||
tags:
|
||||
- ATS测试仿真Api
|
||||
/api/v1/simulation/check/data:
|
||||
post:
|
||||
consumes:
|
||||
|
@ -2468,10 +2544,10 @@ paths:
|
|||
type: string
|
||||
- description: ATS测试仿真-ESB按钮操作
|
||||
in: body
|
||||
name: ButtonOperationReqDto
|
||||
name: EsbButtonOperationReqDto
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.ButtonOperationReqDto'
|
||||
$ref: '#/definitions/dto.EsbButtonOperationReqDto'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
|
@ -2515,7 +2591,7 @@ paths:
|
|||
summary: 获取仿真信息更新通道名称
|
||||
tags:
|
||||
- ATS测试仿真Api
|
||||
/api/v1/simulation/ibp/operation:
|
||||
/api/v1/simulation/ibp/btn/operation:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
|
@ -2528,10 +2604,10 @@ paths:
|
|||
type: string
|
||||
- description: ATS测试仿真-IBP按钮操作
|
||||
in: body
|
||||
name: ButtonOperationReqDto
|
||||
name: IBPButtonOperationReqDto
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.ButtonOperationReqDto'
|
||||
$ref: '#/definitions/dto.IBPButtonOperationReqDto'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
|
@ -2548,6 +2624,72 @@ paths:
|
|||
summary: ATS测试-IBP按钮操作
|
||||
tags:
|
||||
- ATS测试仿真Api
|
||||
/api/v1/simulation/ibp/key/operation:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: ATS测试-IBP钥匙操作
|
||||
parameters:
|
||||
- description: JWT Token
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
- description: ATS测试仿真-IBP钥匙操作
|
||||
in: body
|
||||
name: KeyOperationReqDto
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.KeyOperationReqDto'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
type: string
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/dto.ErrorDto'
|
||||
security:
|
||||
- JwtAuth: []
|
||||
summary: ATS测试-IBP钥匙操作
|
||||
tags:
|
||||
- ATS测试仿真Api
|
||||
/api/v1/simulation/ibp/operation:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: PSL操作
|
||||
parameters:
|
||||
- description: JWT Token
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
- description: PSL操作
|
||||
in: body
|
||||
name: PslOperationReqDto
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.PslOperationReqDto'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
type: string
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/dto.ErrorDto'
|
||||
security:
|
||||
- JwtAuth: []
|
||||
summary: PSL操作
|
||||
tags:
|
||||
- ATS测试仿真Api
|
||||
/api/v1/simulation/list:
|
||||
get:
|
||||
consumes:
|
||||
|
|
|
@ -81,12 +81,18 @@ type SignalOperationReqDto struct {
|
|||
Aspect state.Signal_Aspect `form:"aspect" json:"aspect" binding:"required"` // 当操作为Operation.Display时有效,表示显示的信号
|
||||
}
|
||||
|
||||
type ButtonOperationReqDto struct {
|
||||
type EsbButtonOperationReqDto struct {
|
||||
SimulationId string `form:"simulationId" json:"simulationId" binding:"required"`
|
||||
MapId int32 `json:"mapId" from:"mapId" binding:"required"`
|
||||
Station string `form:"station" json:"station"`
|
||||
Id string `form:"id" json:"id"`
|
||||
ButtonCode string `form:"buttonCode" json:"buttonCode"`
|
||||
Id string `form:"id" json:"id" binding:"required"`
|
||||
Down bool `form:"down" json:"down"`
|
||||
}
|
||||
|
||||
type IBPButtonOperationReqDto struct {
|
||||
SimulationId string `form:"simulationId" json:"simulationId" binding:"required"`
|
||||
MapId int32 `json:"mapId" from:"mapId" binding:"required"`
|
||||
StationId string `form:"stationId" json:"stationId" binding:"required"`
|
||||
ButtonCode string `form:"buttonCode" json:"buttonCode" binding:"required"`
|
||||
Down bool `form:"down" json:"down"`
|
||||
}
|
||||
|
||||
|
@ -98,6 +104,14 @@ type PslOperationReqDto struct {
|
|||
Down bool `form:"down" json:"down"`
|
||||
}
|
||||
|
||||
type KeyOperationReqDto struct {
|
||||
SimulationId string `form:"simulationId" json:"simulationId" binding:"required"`
|
||||
MapId int32 `json:"mapId" from:"mapId" binding:"required"`
|
||||
StationId string `form:"stationId" json:"stationId" binding:"required"`
|
||||
KeyCode string `form:"keyCode" json:"keyCode"`
|
||||
Gear int32 `form:"gear" json:"gear"`
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// 地铁数据检测请求
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 78c09bc53308df8130c8cfc7c44d7727a8868014
|
||||
Subproject commit caeff9b089d9ef20042451120b20ee51a15b26b0
|
Loading…
Reference in New Issue