Bladeren bron

refactor: 仿真测试数据准备添加map.bag

HeWang 9 maanden geleden
bovenliggende
commit
663cbe213d

+ 1 - 1
biz/handler/map_service/map_service.go

@@ -146,7 +146,7 @@ func DownloadMapBagFile(ctx context.Context, c *app.RequestContext) {
 	// 根据id获取对应的oss文件列表
 	fileList, err := util.GetExactedMapFileById(id)
 	// 过滤特定后缀的文件列表
-	fileList = util.FilterBySuffixes(fileList, "map.bag")
+	fileList = util.FilterBySuffixes(fileList, config.MapBagFiltersuffixes...)
 	//fmt.Println("fileList", fileList)
 
 	objectKey := fileList[0]

+ 2 - 2
biz/handler/simulation_service/simulation_service.go

@@ -96,11 +96,11 @@ func generateSimulationZipById(ctx context.Context, id string) (file string, tmp
 	for _, file := range simulationFileList {
 		err = config.OssBucket.GetObjectToFile(file, filepath.Join(baseDir, filepath.Base(file)))
 		if err != nil {
-			fmt.Println("Error downloading file - data.zip, map.pgm, map.yaml:", err)
+			fmt.Println("Error downloading file - data.zip, map.pgm, map.yaml, map.bag:", err)
 			return "", "", err
 		}
 	}
-	c_log.GlobalLogger.Info("下载data.zip, map.pgm, map.yaml文件到根目录 - 成功")
+	c_log.GlobalLogger.Info("下载data.zip, map.pgm, map.yaml, map.bag文件到根目录 - 成功")
 
 	// 下载world文件
 	// 查询状态

+ 2 - 1
common/config/c_map.go

@@ -2,8 +2,9 @@ package config
 
 var (
 	MapBufFiltersuffixes      = []string{"map.pgm", "map.yaml", "map.json", "forbid_area.json"}
+	MapBagFiltersuffixes      = []string{"map.bag"}
 	BuildMapBagFiltersuffixes = []string{"build_map.bag"}
 	OriginMapFiltersuffixes   = []string{"map.pgm", "map.yaml"}
-	SimulationFiltersuffixes  = []string{"data.zip", "map.pgm", "map.yaml"}
+	SimulationFiltersuffixes  = []string{"data.zip", "map.pgm", "map.yaml", "map.bag"}
 	DataFiltersuffixes        = []string{"data.zip"}
 )