【仿真列表增加运行环境ID】

This commit is contained in:
weizhihong 2023-10-27 09:12:40 +08:00
parent 57d1fbad6e
commit ad9d4f57aa
3 changed files with 18 additions and 8 deletions

View File

@ -138,10 +138,11 @@ type CheckMapDataRspDto struct {
// 仿真实例的基本信息响应 // 仿真实例的基本信息响应
type SimulationInfoRspDto struct { type SimulationInfoRspDto struct {
SimulationId string `form:"simulationId" json:"simulationId"` SimulationId string `form:"simulationId" json:"simulationId"`
MapId int32 `json:"mapId" form:"mapId"` MapId int32 `json:"mapId" form:"mapId"`
MapIds []int32 `form:"mapIds" json:"mapIds"` MapIds []int32 `form:"mapIds" json:"mapIds"`
ProjectId int32 `form:"projectId" json:"projectId"` ProjectId int32 `form:"projectId" json:"projectId"`
ProjectRunConfigId int32 `form:"runConfigId" json:"runConfigId" ` // 运行环境ID
} }
type SimulationInfoRspDtoArr []SimulationInfoRspDto type SimulationInfoRspDtoArr []SimulationInfoRspDto

View File

@ -431,6 +431,14 @@ func (s *VerifySimulation) initRunConfig(runConfig *dto.ProjectRunConfigDto) err
return nil return nil
} }
// 获取仿真运行参数ID
func (s *VerifySimulation) GetRunConfigId() int32 {
if s.runConfig == nil {
return 0
}
return s.runConfig.Id
}
// 初始化运行资源 // 初始化运行资源
func (s *VerifySimulation) initRepository() error { func (s *VerifySimulation) initRepository() error {
// 构建Repository // 构建Repository

View File

@ -129,10 +129,11 @@ func ListAllSimulations() []*dto.SimulationInfoRspDto {
simulationMap.Range(func(_, v any) bool { simulationMap.Range(func(_, v any) bool {
s := v.(*memory.VerifySimulation) s := v.(*memory.VerifySimulation)
simArr = append(simArr, &dto.SimulationInfoRspDto{ simArr = append(simArr, &dto.SimulationInfoRspDto{
SimulationId: s.SimulationId, SimulationId: s.SimulationId,
MapId: s.MapIds[0], MapId: s.MapIds[0],
MapIds: s.MapIds, MapIds: s.MapIds,
ProjectId: s.ProjectId, ProjectId: s.ProjectId,
ProjectRunConfigId: s.GetRunConfigId(),
}) })
return true return true
}) })