From a4fd415f10ebdb907c8d67d449d45b36ff912751 Mon Sep 17 00:00:00 2001 From: walker Date: Fri, 13 Oct 2023 17:43:48 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=81=93=E5=B2=94=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/simulation.go | 24 +- .../protos/graphicData/ibpGraphics.pb.go | 2 +- ats/verify/protos/graphicData/picture.pb.go | 2 +- .../protos/graphicData/pslGraphics.pb.go | 2 +- .../relayCabinetLayoutGraphics.pb.go | 2 +- .../graphicData/stationLayoutGraphics.pb.go | 2 +- ats/verify/protos/state/device_state.pb.go | 2 +- .../wayside/memory/wayside_memory_signal.go | 53 ++- .../wayside/memory/wayside_memory_turnout.go | 27 ++ bj-rtss-message | 2 +- dto/request_proto/request.pb.go | 308 ++++++++++++++++++ dto/simulation_dto/turnout.go | 13 + dto/simulation_dto/turnout_test.go | 27 ++ rtss_simulation | 2 +- 14 files changed, 420 insertions(+), 48 deletions(-) create mode 100644 dto/request_proto/request.pb.go create mode 100644 dto/simulation_dto/turnout.go create mode 100644 dto/simulation_dto/turnout_test.go diff --git a/api/simulation.go b/api/simulation.go index 542f042..f0dd8d0 100644 --- a/api/simulation.go +++ b/api/simulation.go @@ -15,6 +15,7 @@ import ( "joylink.club/bj-rtsts-server/ats/verify/simulation/wayside/memory" "joylink.club/bj-rtsts-server/config" "joylink.club/bj-rtsts-server/dto" + "joylink.club/bj-rtsts-server/dto/request_proto" apiproto "joylink.club/bj-rtsts-server/grpcproto" "joylink.club/bj-rtsts-server/middleware" "joylink.club/bj-rtsts-server/service" @@ -234,17 +235,18 @@ func removeTrain(c *gin.Context) { // @Failure 500 {object} dto.ErrorDto // @Router /api/v1/simulation/switch/operation [post] func switchOperation(c *gin.Context) { - req := &dto.SwitchOperationReqDto{} + req := &request_proto.TurnoutOperationReq{} if err := c.ShouldBind(&req); err != nil { panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) } simulation := checkDeviceDataAndReturn(req.SimulationId) slog.Info("传入状态参数", req) - memory.ChangeTurnoutState(simulation, &state.SwitchState{ - Id: req.DeviceId, - Normal: req.TurnNormal, - Reverse: req.TurnReverse, - }, req.MapId) + memory.HandleTurnoutOperation(simulation, req) + // memory.ChangeTurnoutState(simulation, &state.SwitchState{ + // Id: req.DeviceId, + // Normal: req.TurnNormal, + // Reverse: req.TurnReverse, + // }, req.MapId) c.JSON(http.StatusOK, "ok") } @@ -269,12 +271,12 @@ func signalOperation(c *gin.Context) { if err := c.ShouldBind(&req); err != nil { panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) } - simulation := checkDeviceDataAndReturn(req.SimulationId) + // simulation := checkDeviceDataAndReturn(req.SimulationId) slog.Info("传入状态参数", req) - memory.ChangeSignalState(simulation, &state.SignalState{ - Id: req.DeviceId, - Aspect: req.Aspect, - }, req.MapId) + // memory.ChangeSignalState(simulation, &state.SignalState{ + // Id: req.DeviceId, + // Aspect: req.Aspect, + // }, req.MapId) c.JSON(http.StatusOK, "ok") } diff --git a/ats/verify/protos/graphicData/ibpGraphics.pb.go b/ats/verify/protos/graphicData/ibpGraphics.pb.go index a25f337..5ad8ac2 100644 --- a/ats/verify/protos/graphicData/ibpGraphics.pb.go +++ b/ats/verify/protos/graphicData/ibpGraphics.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.31.0 // protoc v4.23.1 // source: ibpGraphics.proto diff --git a/ats/verify/protos/graphicData/picture.pb.go b/ats/verify/protos/graphicData/picture.pb.go index 30b00db..ef7ff2a 100644 --- a/ats/verify/protos/graphicData/picture.pb.go +++ b/ats/verify/protos/graphicData/picture.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.31.0 // protoc v4.23.1 // source: picture.proto diff --git a/ats/verify/protos/graphicData/pslGraphics.pb.go b/ats/verify/protos/graphicData/pslGraphics.pb.go index 6dffc73..8a23f4b 100644 --- a/ats/verify/protos/graphicData/pslGraphics.pb.go +++ b/ats/verify/protos/graphicData/pslGraphics.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.31.0 // protoc v4.23.1 // source: pslGraphics.proto diff --git a/ats/verify/protos/graphicData/relayCabinetLayoutGraphics.pb.go b/ats/verify/protos/graphicData/relayCabinetLayoutGraphics.pb.go index 3e534ca..9b2d239 100644 --- a/ats/verify/protos/graphicData/relayCabinetLayoutGraphics.pb.go +++ b/ats/verify/protos/graphicData/relayCabinetLayoutGraphics.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.31.0 // protoc v4.23.1 // source: relayCabinetLayoutGraphics.proto diff --git a/ats/verify/protos/graphicData/stationLayoutGraphics.pb.go b/ats/verify/protos/graphicData/stationLayoutGraphics.pb.go index c3677b1..9c7f8c7 100644 --- a/ats/verify/protos/graphicData/stationLayoutGraphics.pb.go +++ b/ats/verify/protos/graphicData/stationLayoutGraphics.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.31.0 // protoc v4.23.1 // source: stationLayoutGraphics.proto diff --git a/ats/verify/protos/state/device_state.pb.go b/ats/verify/protos/state/device_state.pb.go index 3e8ee18..ba1bbdc 100644 --- a/ats/verify/protos/state/device_state.pb.go +++ b/ats/verify/protos/state/device_state.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.31.0 // protoc v4.23.1 // source: device_state.proto diff --git a/ats/verify/simulation/wayside/memory/wayside_memory_signal.go b/ats/verify/simulation/wayside/memory/wayside_memory_signal.go index 1727cc9..50c9e7c 100644 --- a/ats/verify/simulation/wayside/memory/wayside_memory_signal.go +++ b/ats/verify/simulation/wayside/memory/wayside_memory_signal.go @@ -1,41 +1,36 @@ package memory import ( - "fmt" - "joylink.club/bj-rtsts-server/ats/verify/protos/graphicData" "joylink.club/bj-rtsts-server/ats/verify/protos/state" "joylink.club/ecs" - "joylink.club/rtsssimulation/consts" "joylink.club/rtsssimulation/fi" - "joylink.club/rtsssimulation/repository" - "joylink.club/rtsssimulation/repository/model/proto" ) func ChangeSignalState(simulation *VerifySimulation, status *state.SignalState, mapId int32) { - signalUid := QueryUidByMidAndComId(mapId, status.Id, &graphicData.Signal{}) - signalModel, err := simulation.Repo.FindModel(signalUid, proto.DeviceType_DeviceType_Signal) - if err != nil { - panic(fmt.Sprintf("信号机[%s]模型不存在", signalUid)) - } - signalGroupCode := signalModel.(*repository.Signal).Code() - switch signalGroupCode { - case consts.SIGNAL_2XH1: - changeSignal2XH1State(simulation.World, signalUid, status.GetAspect()) - case consts.SIGNAL_3XH1: - changeSignal3XH1State(simulation.World, signalUid, status.GetAspect()) - case consts.SIGNAL_3XH2: - changeSignal3XH2State(simulation.World, signalUid, status.GetAspect()) - case consts.SIGNAL_3XH3: - changeSignal3XH3State(simulation.World, signalUid, status.GetAspect()) - case consts.SIGNAL_3XH4: - changeSignal3XH4State(simulation.World, signalUid, status.GetAspect()) - case consts.SIGNAL_DCXH: - changeSignalDCXHState(simulation.World, signalUid, status.GetAspect()) - case consts.SIGNAL_JCKXH: - changeSignalJCKXHState(simulation.World, signalUid, status.GetAspect()) - default: - panic(fmt.Sprintf("操作[%s]的信号机,无法识别组合类型[%s]", signalUid, signalGroupCode)) - } + // signalUid := QueryUidByMidAndComId(mapId, status.Id, &graphicData.Signal{}) + // signalModel, err := simulation.Repo.FindModel(signalUid, proto.DeviceType_DeviceType_Signal) + // if err != nil { + // panic(fmt.Sprintf("信号机[%s]模型不存在", signalUid)) + // } + // signalGroupCode := signalModel.(*repository.Signal).Code() + // switch signalGroupCode { + // case consts.SIGNAL_2XH1: + // changeSignal2XH1State(simulation.World, signalUid, status.GetAspect()) + // case consts.SIGNAL_3XH1: + // changeSignal3XH1State(simulation.World, signalUid, status.GetAspect()) + // case consts.SIGNAL_3XH2: + // changeSignal3XH2State(simulation.World, signalUid, status.GetAspect()) + // case consts.SIGNAL_3XH3: + // changeSignal3XH3State(simulation.World, signalUid, status.GetAspect()) + // case consts.SIGNAL_3XH4: + // changeSignal3XH4State(simulation.World, signalUid, status.GetAspect()) + // case consts.SIGNAL_DCXH: + // changeSignalDCXHState(simulation.World, signalUid, status.GetAspect()) + // case consts.SIGNAL_JCKXH: + // changeSignalJCKXHState(simulation.World, signalUid, status.GetAspect()) + // default: + // panic(fmt.Sprintf("操作[%s]的信号机,无法识别组合类型[%s]", signalUid, signalGroupCode)) + // } } func changeSignalJCKXHState(w ecs.World, signalUid string, toAspect state.Signal_Aspect) { switch toAspect { diff --git a/ats/verify/simulation/wayside/memory/wayside_memory_turnout.go b/ats/verify/simulation/wayside/memory/wayside_memory_turnout.go index 984c50a..0170a80 100644 --- a/ats/verify/simulation/wayside/memory/wayside_memory_turnout.go +++ b/ats/verify/simulation/wayside/memory/wayside_memory_turnout.go @@ -5,11 +5,13 @@ import ( "joylink.club/ecs" "joylink.club/rtsssimulation/component" + "joylink.club/rtsssimulation/component/component_proto" "joylink.club/rtsssimulation/entity" "joylink.club/rtsssimulation/fi" "joylink.club/bj-rtsts-server/ats/verify/protos/graphicData" "joylink.club/bj-rtsts-server/ats/verify/protos/state" + "joylink.club/bj-rtsts-server/dto/request_proto" ) // 道岔相关道岔操作方法 @@ -22,6 +24,31 @@ func ChangeTurnoutState(simulation *VerifySimulation, status *state.SwitchState, } } +// 处理道岔操作 +func HandleTurnoutOperation(simulation *VerifySimulation, req *request_proto.TurnoutOperationReq) { + uid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &graphicData.Turnout{}) + switch req.Operation { + case request_proto.Turnout_DC: + fi.DriveTurnoutDCOn(simulation.World, uid) + case request_proto.Turnout_CancelDC: + fi.DriveTurnoutDCOff(simulation.World, uid) + case request_proto.Turnout_FC: + fi.DriveTurnoutFCOn(simulation.World, uid) + case request_proto.Turnout_CancelFC: + fi.DriveTurnoutFCOff(simulation.World, uid) + case request_proto.Turnout_SetSB: + fi.SetTurnoutFault(simulation.World, uid, component_proto.Turnout_SB) + case request_proto.Turnout_CancelSB: + fi.CancelTurnoutFault(simulation.World, uid, component_proto.Turnout_SB) + case request_proto.Turnout_SetJC: + fi.SetTurnoutFault(simulation.World, uid, component_proto.Turnout_JC) + case request_proto.Turnout_CancelJC: + fi.CancelTurnoutFault(simulation.World, uid, component_proto.Turnout_JC) + default: + panic(fmt.Sprintf("未知的道岔操作:%s", req.Operation)) + } +} + // 获取全部的道岔状态,动力学使用 func GetAllTurnoutState(sim *VerifySimulation) []*state.SwitchState { var switchArr []*state.SwitchState diff --git a/bj-rtss-message b/bj-rtss-message index 7a24c7a..f43d8db 160000 --- a/bj-rtss-message +++ b/bj-rtss-message @@ -1 +1 @@ -Subproject commit 7a24c7aae20f83fa2bba4639066dff9b267f6d38 +Subproject commit f43d8dbec4b997ef729ceb6e086db1bd066c0790 diff --git a/dto/request_proto/request.pb.go b/dto/request_proto/request.pb.go new file mode 100644 index 0000000..6bc0695 --- /dev/null +++ b/dto/request_proto/request.pb.go @@ -0,0 +1,308 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.23.1 +// source: request.proto + +package request_proto + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 道岔操作 +type Turnout_Operation int32 + +const ( + Turnout_Undefined Turnout_Operation = 0 // 未定义 + Turnout_DC Turnout_Operation = 1 // 定操 + Turnout_CancelDC Turnout_Operation = 2 // 取消定操 + Turnout_FC Turnout_Operation = 3 // 反操 + Turnout_CancelFC Turnout_Operation = 4 // 取消反操 + Turnout_SetSB Turnout_Operation = 5 // 设置失表故障 + Turnout_CancelSB Turnout_Operation = 6 // 取消失表故障 + Turnout_SetJC Turnout_Operation = 7 // 设置挤岔故障 + Turnout_CancelJC Turnout_Operation = 8 // 取消挤岔故障 +) + +// Enum value maps for Turnout_Operation. +var ( + Turnout_Operation_name = map[int32]string{ + 0: "Undefined", + 1: "DC", + 2: "CancelDC", + 3: "FC", + 4: "CancelFC", + 5: "SetSB", + 6: "CancelSB", + 7: "SetJC", + 8: "CancelJC", + } + Turnout_Operation_value = map[string]int32{ + "Undefined": 0, + "DC": 1, + "CancelDC": 2, + "FC": 3, + "CancelFC": 4, + "SetSB": 5, + "CancelSB": 6, + "SetJC": 7, + "CancelJC": 8, + } +) + +func (x Turnout_Operation) Enum() *Turnout_Operation { + p := new(Turnout_Operation) + *p = x + return p +} + +func (x Turnout_Operation) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Turnout_Operation) Descriptor() protoreflect.EnumDescriptor { + return file_request_proto_enumTypes[0].Descriptor() +} + +func (Turnout_Operation) Type() protoreflect.EnumType { + return &file_request_proto_enumTypes[0] +} + +func (x Turnout_Operation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Turnout_Operation.Descriptor instead. +func (Turnout_Operation) EnumDescriptor() ([]byte, []int) { + return file_request_proto_rawDescGZIP(), []int{0, 0} +} + +// 道岔 +type Turnout struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Turnout) Reset() { + *x = Turnout{} + if protoimpl.UnsafeEnabled { + mi := &file_request_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Turnout) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Turnout) ProtoMessage() {} + +func (x *Turnout) ProtoReflect() protoreflect.Message { + mi := &file_request_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Turnout.ProtoReflect.Descriptor instead. +func (*Turnout) Descriptor() ([]byte, []int) { + return file_request_proto_rawDescGZIP(), []int{0} +} + +// 道岔操作请求 +type TurnoutOperationReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SimulationId string `protobuf:"bytes,1,opt,name=simulationId,proto3" json:"simulationId,omitempty"` // 仿真id + MapId int32 `protobuf:"varint,2,opt,name=mapId,proto3" json:"mapId,omitempty"` // 图id + DeviceId string `protobuf:"bytes,3,opt,name=deviceId,proto3" json:"deviceId,omitempty"` // 设备id + Operation Turnout_Operation `protobuf:"varint,4,opt,name=operation,proto3,enum=request.Turnout_Operation" json:"operation,omitempty"` // 道岔操作 +} + +func (x *TurnoutOperationReq) Reset() { + *x = TurnoutOperationReq{} + if protoimpl.UnsafeEnabled { + mi := &file_request_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TurnoutOperationReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TurnoutOperationReq) ProtoMessage() {} + +func (x *TurnoutOperationReq) ProtoReflect() protoreflect.Message { + mi := &file_request_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TurnoutOperationReq.ProtoReflect.Descriptor instead. +func (*TurnoutOperationReq) Descriptor() ([]byte, []int) { + return file_request_proto_rawDescGZIP(), []int{1} +} + +func (x *TurnoutOperationReq) GetSimulationId() string { + if x != nil { + return x.SimulationId + } + return "" +} + +func (x *TurnoutOperationReq) GetMapId() int32 { + if x != nil { + return x.MapId + } + return 0 +} + +func (x *TurnoutOperationReq) GetDeviceId() string { + if x != nil { + return x.DeviceId + } + return "" +} + +func (x *TurnoutOperationReq) GetOperation() Turnout_Operation { + if x != nil { + return x.Operation + } + return Turnout_Undefined +} + +var File_request_proto protoreflect.FileDescriptor + +var file_request_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x83, 0x01, 0x0a, 0x07, 0x54, 0x75, 0x72, + 0x6e, 0x6f, 0x75, 0x74, 0x22, 0x78, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x10, 0x00, + 0x12, 0x06, 0x0a, 0x02, 0x44, 0x43, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x44, 0x43, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x46, 0x43, 0x10, 0x03, 0x12, 0x0c, + 0x0a, 0x08, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x46, 0x43, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, + 0x53, 0x65, 0x74, 0x53, 0x42, 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x53, 0x42, 0x10, 0x06, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x65, 0x74, 0x4a, 0x43, 0x10, 0x07, + 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4a, 0x43, 0x10, 0x08, 0x22, 0xa5, + 0x01, 0x0a, 0x13, 0x54, 0x75, 0x72, 0x6e, 0x6f, 0x75, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x69, + 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, + 0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x61, 0x70, 0x49, 0x64, + 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x09, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x1a, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x75, 0x72, 0x6e, 0x6f, 0x75, + 0x74, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x15, 0x5a, 0x13, 0x2e, 0x2f, 0x64, 0x74, 0x6f, 0x2f, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_request_proto_rawDescOnce sync.Once + file_request_proto_rawDescData = file_request_proto_rawDesc +) + +func file_request_proto_rawDescGZIP() []byte { + file_request_proto_rawDescOnce.Do(func() { + file_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_request_proto_rawDescData) + }) + return file_request_proto_rawDescData +} + +var file_request_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_request_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_request_proto_goTypes = []interface{}{ + (Turnout_Operation)(0), // 0: request.Turnout.Operation + (*Turnout)(nil), // 1: request.Turnout + (*TurnoutOperationReq)(nil), // 2: request.TurnoutOperationReq +} +var file_request_proto_depIdxs = []int32{ + 0, // 0: request.TurnoutOperationReq.operation:type_name -> request.Turnout.Operation + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_request_proto_init() } +func file_request_proto_init() { + if File_request_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Turnout); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_request_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TurnoutOperationReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_request_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_request_proto_goTypes, + DependencyIndexes: file_request_proto_depIdxs, + EnumInfos: file_request_proto_enumTypes, + MessageInfos: file_request_proto_msgTypes, + }.Build() + File_request_proto = out.File + file_request_proto_rawDesc = nil + file_request_proto_goTypes = nil + file_request_proto_depIdxs = nil +} diff --git a/dto/simulation_dto/turnout.go b/dto/simulation_dto/turnout.go new file mode 100644 index 0000000..4e32a33 --- /dev/null +++ b/dto/simulation_dto/turnout.go @@ -0,0 +1,13 @@ +package simulationdto + +import ( + "joylink.club/bj-rtsts-server/dto/request_proto" +) + +// 道岔操作请求DTO +type TurnoutOperationReqDto struct { + SimulationId string `form:"simulationId" json:"simulationId" binding:"required"` + MapId int32 `json:"mapId" from:"mapId" binding:"required"` + DeviceId string `form:"id" json:"id" binding:"required"` + Operation request_proto.Turnout_Operation `form:"operation" json:"operation" binding:"required"` +} diff --git a/dto/simulation_dto/turnout_test.go b/dto/simulation_dto/turnout_test.go new file mode 100644 index 0000000..dd20b24 --- /dev/null +++ b/dto/simulation_dto/turnout_test.go @@ -0,0 +1,27 @@ +package simulationdto_test + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/assert" + "joylink.club/bj-rtsts-server/dto/request_proto" +) + +func TestTurnoutOperationReqDto(t *testing.T) { + b, err := json.Marshal(&request_proto.TurnoutOperationReq{ + SimulationId: "1", + MapId: 2, + DeviceId: "3", + Operation: 2, + }) + if err != nil { + panic(err) + } + var o request_proto.TurnoutOperationReq + err = json.Unmarshal(b, &o) + if err != nil { + panic(err) + } + assert.Equal(t, request_proto.Turnout_Operation(2), o.Operation) +} diff --git a/rtss_simulation b/rtss_simulation index f9d845a..a9c004a 160000 --- a/rtss_simulation +++ b/rtss_simulation @@ -1 +1 @@ -Subproject commit f9d845a0cf0bb6375eaa93c2011b46b63c5a0e9f +Subproject commit a9c004a0f02ad94e4334a6d910630312554d4ff1 From 7138c78734b07ac746eecc4fd4b45f56d625bbba Mon Sep 17 00:00:00 2001 From: walker Date: Mon, 16 Oct 2023 09:05:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=81=93=E5=B2=94?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=8E=A5=E5=8F=A3API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/simulation.go | 2 +- bj-rtss-message | 2 +- docs/docs.go | 245 +++++++++++++++++++++++++++++++++++----------- docs/swagger.json | 245 +++++++++++++++++++++++++++++++++++----------- docs/swagger.yaml | 169 +++++++++++++++++++++++++------- rtss_simulation | 2 +- 6 files changed, 518 insertions(+), 147 deletions(-) diff --git a/api/simulation.go b/api/simulation.go index f0dd8d0..a866e26 100644 --- a/api/simulation.go +++ b/api/simulation.go @@ -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 diff --git a/bj-rtss-message b/bj-rtss-message index f43d8db..c18ac28 160000 --- a/bj-rtss-message +++ b/bj-rtss-message @@ -1 +1 @@ -Subproject commit f43d8dbec4b997ef729ceb6e086db1bd066c0790 +Subproject commit c18ac281a6360f6ceceb1df93c86dc888879fe46 diff --git a/docs/docs.go b/docs/docs.go index 0953445..09682fc 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -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": { diff --git a/docs/swagger.json b/docs/swagger.json index 1515196..92f8326 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -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": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 5d62b66..cd1f23e 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -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: diff --git a/rtss_simulation b/rtss_simulation index a9c004a..1babd47 160000 --- a/rtss_simulation +++ b/rtss_simulation @@ -1 +1 @@ -Subproject commit a9c004a0f02ad94e4334a6d910630312554d4ff1 +Subproject commit 1babd47d2877b3d2485432c78a92d749290e86dd