You've already forked FrameTour-BE
refactor(device): 移除设备与景区的冗余配置接口
Some checks failed
ZhenTu-BE/pipeline/head There was a failure building this commit
Some checks failed
ZhenTu-BE/pipeline/head There was a failure building this commit
- 删除 DeviceV2Controller 中的设备配置相关接口 - 删除 ScenicV2Controller 中的景区配置相关接口 - 移除 DeviceConfigV2Client 中的扁平化配置接口 - 移除 DeviceV2Client 中的设备详情配置接口 - 更新 DeviceIntegrationExample 示例代码 - 移除 DeviceIntegrationFallbackExample 中的配置缓存示例 - 删除 DeviceConfigIntegrationService 中的配置获取方法 - 删除 DeviceIntegrationService 中的设备配置服务方法- 移除 RenderWorkerV2Client 中的工作器配置接口- 删除 RenderWorkerConfigIntegrationService 中的配置键名- 移除 RenderWorkerIntegrationService 中的工作器配置方法 - 删除 ScenicConfigV2Client 中的扁平化配置接口 - 移除 ScenicV2Client 中的景区配置接口 - 更新 ScenicIntegrationExample 示例代码 - 删除 ScenicConfigIntegrationService 中的配置获取方法 - 删除 ScenicIntegrationService 中的景区配置服务方法 - 修改 ScenicRepository 中景区实体获取逻辑
This commit is contained in:
@@ -52,8 +52,27 @@ public class ScenicRepository {
|
||||
}
|
||||
|
||||
public ScenicEntity getScenic(Long id) {
|
||||
ScenicV2WithConfigDTO scenicDTO = scenicIntegrationService.getScenicWithConfig(id);
|
||||
ScenicEntity scenicEntity = convertToScenicEntity(scenicDTO);
|
||||
// 分别获取景区基础信息和配置信息
|
||||
ScenicV2DTO scenicBasic = scenicIntegrationService.getScenic(id);
|
||||
List<ScenicConfigV2DTO> configList = scenicConfigIntegrationService.listConfigs(id);
|
||||
|
||||
// 将配置列表转换为Map
|
||||
Map<String, Object> configMap = new HashMap<>();
|
||||
if (configList != null) {
|
||||
for (ScenicConfigV2DTO config : configList) {
|
||||
configMap.put(config.getConfigKey(), config.getConfigValue());
|
||||
}
|
||||
}
|
||||
|
||||
// 手动组合成WithConfig对象用于转换
|
||||
ScenicV2WithConfigDTO scenicWithConfig = new ScenicV2WithConfigDTO();
|
||||
scenicWithConfig.setId(scenicBasic.getId());
|
||||
scenicWithConfig.setName(scenicBasic.getName());
|
||||
scenicWithConfig.setMpId(scenicBasic.getMpId());
|
||||
scenicWithConfig.setStatus(scenicBasic.getStatus());
|
||||
scenicWithConfig.setConfig(configMap);
|
||||
|
||||
ScenicEntity scenicEntity = convertToScenicEntity(scenicWithConfig);
|
||||
return scenicEntity;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user