From ad9d4f57aadd087729105546d7e5749accbb4a9e Mon Sep 17 00:00:00 2001 From: weizhihong Date: Fri, 27 Oct 2023 09:12:40 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=BF=E7=9C=9F=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BF=90=E8=A1=8C=E7=8E=AF=E5=A2=83ID?= =?UTF-8?q?=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dto/simulation.go | 9 +++++---- ts/simulation/wayside/memory/wayside_simulation.go | 8 ++++++++ ts/test_simulation_manage.go | 9 +++++---- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/dto/simulation.go b/dto/simulation.go index b09d71c..f8dee89 100644 --- a/dto/simulation.go +++ b/dto/simulation.go @@ -138,10 +138,11 @@ type CheckMapDataRspDto struct { // 仿真实例的基本信息响应 type SimulationInfoRspDto struct { - SimulationId string `form:"simulationId" json:"simulationId"` - MapId int32 `json:"mapId" form:"mapId"` - MapIds []int32 `form:"mapIds" json:"mapIds"` - ProjectId int32 `form:"projectId" json:"projectId"` + SimulationId string `form:"simulationId" json:"simulationId"` + MapId int32 `json:"mapId" form:"mapId"` + MapIds []int32 `form:"mapIds" json:"mapIds"` + ProjectId int32 `form:"projectId" json:"projectId"` + ProjectRunConfigId int32 `form:"runConfigId" json:"runConfigId" ` // 运行环境ID } type SimulationInfoRspDtoArr []SimulationInfoRspDto diff --git a/ts/simulation/wayside/memory/wayside_simulation.go b/ts/simulation/wayside/memory/wayside_simulation.go index e693cd7..8ae81fe 100644 --- a/ts/simulation/wayside/memory/wayside_simulation.go +++ b/ts/simulation/wayside/memory/wayside_simulation.go @@ -431,6 +431,14 @@ func (s *VerifySimulation) initRunConfig(runConfig *dto.ProjectRunConfigDto) err return nil } +// 获取仿真运行参数ID +func (s *VerifySimulation) GetRunConfigId() int32 { + if s.runConfig == nil { + return 0 + } + return s.runConfig.Id +} + // 初始化运行资源 func (s *VerifySimulation) initRepository() error { // 构建Repository diff --git a/ts/test_simulation_manage.go b/ts/test_simulation_manage.go index 127a7dd..c162857 100644 --- a/ts/test_simulation_manage.go +++ b/ts/test_simulation_manage.go @@ -129,10 +129,11 @@ func ListAllSimulations() []*dto.SimulationInfoRspDto { simulationMap.Range(func(_, v any) bool { s := v.(*memory.VerifySimulation) simArr = append(simArr, &dto.SimulationInfoRspDto{ - SimulationId: s.SimulationId, - MapId: s.MapIds[0], - MapIds: s.MapIds, - ProjectId: s.ProjectId, + SimulationId: s.SimulationId, + MapId: s.MapIds[0], + MapIds: s.MapIds, + ProjectId: s.ProjectId, + ProjectRunConfigId: s.GetRunConfigId(), }) return true })