From b5250158530d7de03e2fa177e3ade5923cb0d91d Mon Sep 17 00:00:00 2001 From: tiger_zhou Date: Tue, 6 Feb 2024 10:51:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=91=81=E9=92=AE=E6=97=81=E8=B7=AF=E5=8F=8A?= =?UTF-8?q?=E6=97=81=E8=B7=AF=E5=A4=8D=E4=BD=8D=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs.go | 116 ------------------ docs/swagger.json | 116 ------------------ docs/swagger.yaml | 80 ------------ .../memory/wayside_memory_btnandkey_bypass.go | 51 -------- 4 files changed, 363 deletions(-) delete mode 100644 ts/simulation/wayside/memory/wayside_memory_btnandkey_bypass.go diff --git a/docs/docs.go b/docs/docs.go index a8fbf93..34fdcb6 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -3604,58 +3604,6 @@ const docTemplate = `{ } } }, - "/api/v1/simulation/bypass/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": "BypassOperationReq", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request_proto.BypassOperationReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/dto.ErrorDto" - } - } - } - } - }, "/api/v1/simulation/check/data": { "post": { "security": [ @@ -6234,70 +6182,6 @@ const docTemplate = `{ } } }, - "request_proto.BypassOperationReq": { - "type": "object", - "properties": { - "btnType": { - "$ref": "#/definitions/request_proto.BypassOperationReq_BtnType" - }, - "deviceCode": { - "description": "设备code", - "type": "string" - }, - "deviceId": { - "description": "设备id", - "type": "integer" - }, - "gateBoxId": { - "type": "integer" - }, - "mapId": { - "description": "图id", - "type": "integer" - }, - "operation": { - "$ref": "#/definitions/request_proto.BypassOperationReq_Operation" - }, - "simulationId": { - "description": "仿真id", - "type": "string" - }, - "stationId": { - "description": "车站id", - "type": "integer" - } - } - }, - "request_proto.BypassOperationReq_BtnType": { - "type": "integer", - "enum": [ - 0, - 1, - 2, - 3 - ], - "x-enum-varnames": [ - "BypassOperationReq_esb_btn", - "BypassOperationReq_ibp_btn", - "BypassOperationReq_ibp_key", - "BypassOperationReq_pls_btn" - ] - }, - "request_proto.BypassOperationReq_Operation": { - "type": "integer", - "enum": [ - 0, - 1 - ], - "x-enum-comments": { - "BypassOperationReq_bypass": "旁路", - "BypassOperationReq_bypass_reset": "旁路重置" - }, - "x-enum-varnames": [ - "BypassOperationReq_bypass", - "BypassOperationReq_bypass_reset" - ] - }, "request_proto.PointsOperationReq": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index bdb218e..27bd33a 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -3598,58 +3598,6 @@ } } }, - "/api/v1/simulation/bypass/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": "BypassOperationReq", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request_proto.BypassOperationReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/dto.ErrorDto" - } - } - } - } - }, "/api/v1/simulation/check/data": { "post": { "security": [ @@ -6228,70 +6176,6 @@ } } }, - "request_proto.BypassOperationReq": { - "type": "object", - "properties": { - "btnType": { - "$ref": "#/definitions/request_proto.BypassOperationReq_BtnType" - }, - "deviceCode": { - "description": "设备code", - "type": "string" - }, - "deviceId": { - "description": "设备id", - "type": "integer" - }, - "gateBoxId": { - "type": "integer" - }, - "mapId": { - "description": "图id", - "type": "integer" - }, - "operation": { - "$ref": "#/definitions/request_proto.BypassOperationReq_Operation" - }, - "simulationId": { - "description": "仿真id", - "type": "string" - }, - "stationId": { - "description": "车站id", - "type": "integer" - } - } - }, - "request_proto.BypassOperationReq_BtnType": { - "type": "integer", - "enum": [ - 0, - 1, - 2, - 3 - ], - "x-enum-varnames": [ - "BypassOperationReq_esb_btn", - "BypassOperationReq_ibp_btn", - "BypassOperationReq_ibp_key", - "BypassOperationReq_pls_btn" - ] - }, - "request_proto.BypassOperationReq_Operation": { - "type": "integer", - "enum": [ - 0, - 1 - ], - "x-enum-comments": { - "BypassOperationReq_bypass": "旁路", - "BypassOperationReq_bypass_reset": "旁路重置" - }, - "x-enum-varnames": [ - "BypassOperationReq_bypass", - "BypassOperationReq_bypass_reset" - ] - }, "request_proto.PointsOperationReq": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index c86605b..fa8e066 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -785,53 +785,6 @@ definitions: description: 数据类型 type: integer type: object - request_proto.BypassOperationReq: - properties: - btnType: - $ref: '#/definitions/request_proto.BypassOperationReq_BtnType' - deviceCode: - description: 设备code - type: string - deviceId: - description: 设备id - type: integer - gateBoxId: - type: integer - mapId: - description: 图id - type: integer - operation: - $ref: '#/definitions/request_proto.BypassOperationReq_Operation' - simulationId: - description: 仿真id - type: string - stationId: - description: 车站id - type: integer - type: object - request_proto.BypassOperationReq_BtnType: - enum: - - 0 - - 1 - - 2 - - 3 - type: integer - x-enum-varnames: - - BypassOperationReq_esb_btn - - BypassOperationReq_ibp_btn - - BypassOperationReq_ibp_key - - BypassOperationReq_pls_btn - request_proto.BypassOperationReq_Operation: - enum: - - 0 - - 1 - type: integer - x-enum-comments: - BypassOperationReq_bypass: 旁路 - BypassOperationReq_bypass_reset: 旁路重置 - x-enum-varnames: - - BypassOperationReq_bypass - - BypassOperationReq_bypass_reset request_proto.Points_Force: enum: - 0 @@ -3353,39 +3306,6 @@ paths: summary: 应答器报文停止发送 tags: - ATS测试仿真Api - /api/v1/simulation/bypass/operation: - post: - consumes: - - application/json - description: ATS测试仿真-移除列车 - parameters: - - description: JWT Token - in: header - name: Authorization - required: true - type: string - - description: ATS测试仿真-摁钮,钥匙设置旁路 - in: body - name: BypassOperationReq - required: true - schema: - $ref: '#/definitions/request_proto.BypassOperationReq' - 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/check/data: post: consumes: diff --git a/ts/simulation/wayside/memory/wayside_memory_btnandkey_bypass.go b/ts/simulation/wayside/memory/wayside_memory_btnandkey_bypass.go deleted file mode 100644 index 41fe05e..0000000 --- a/ts/simulation/wayside/memory/wayside_memory_btnandkey_bypass.go +++ /dev/null @@ -1,51 +0,0 @@ -package memory - -import ( - "fmt" - "joylink.club/bj-rtsts-server/dto/data_proto" - "joylink.club/bj-rtsts-server/dto/request_proto" - "joylink.club/rtsssimulation/fi" -) - -func ChangeBtnAndkeyBypass(sim *VerifySimulation, req *request_proto.BypassOperationReq) error { - - switch req.BtnType { - case request_proto.BypassOperationReq_esb_btn: - uid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &data_proto.EsbButton{}) - fi.SetBypassBtn(sim.World, uid, req.Operation) - return nil - case request_proto.BypassOperationReq_ibp_btn: - uidMap, err := getIbpUidByMapIdAndStationId(req.MapId, req.StationId) - if err != nil { - return err - } - if uidMap.IbpButtonIds[req.DeviceId] == nil { - return fmt.Errorf("车站【%d】按钮【%d】UID不存在", req.StationId, req.DeviceId) - } - stationUid := QueryUidByMidAndComId(req.MapId, req.StationId, &data_proto.Station{}) - devUid := stationUid + "_" + uidMap.IbpButtonIds[req.DeviceId].Uid - - fi.SetBypassBtn(sim.World, devUid, req.Operation) - return nil - case request_proto.BypassOperationReq_ibp_key: - uidMap, err := getIbpUidByMapIdAndStationId(req.MapId, req.StationId) - if err != nil { - return err - } - if uidMap.IbpKeyIds[req.DeviceId] == nil { - return fmt.Errorf("车站【%d】钥匙【%d】UID不存在", req.StationId, req.DeviceId) - } - stationUid := QueryUidByMidAndComId(req.MapId, req.StationId, &data_proto.Station{}) - devUid := stationUid + "_" + uidMap.IbpKeyIds[req.DeviceId].Uid - fi.SetBypassSwitchKey(sim.World, devUid, req.Operation) - return nil - case request_proto.BypassOperationReq_pls_btn: - uid := QueryUidStructure[*StationUidStructure](req.MapId) - gateBoxUid := uid.GateBoxIds[req.GateBoxId].Uid - devUid := fmt.Sprintf("%v_%v", gateBoxUid, req.DeviceCode) - fi.SetBypassBtn(sim.World, devUid, req.Operation) - return nil - default: - return fmt.Errorf("设置旁路不能确定的类型[%v]", req.BtnType) - } -}