You've already forked FrameTour-BE
feat(integration): 添加渲染工作器配置管理功能
- 新增 RenderWorkerConfigManager 类实现渲染工作器配置的管理功能 - 在 RenderWorkerRepository 中集成 RenderWorkerConfigManager - 添加方法 getWorkerConfigManager 获取渲染工作器配置管理器实例 - 优化 getWorkerByAccessKey 和 getWorker 方法,使用集成服务获取工作器信息
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
package com.ycwl.basic.integration.common.manager;
|
||||
|
||||
import com.ycwl.basic.integration.render.dto.config.RenderWorkerConfigV2DTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 渲染工作器配置管理器
|
||||
* 基于通用ConfigManager实现渲染工作器配置的管理功能
|
||||
*/
|
||||
public class RenderWorkerConfigManager extends ConfigManager<RenderWorkerConfigV2DTO> {
|
||||
|
||||
public RenderWorkerConfigManager(List<RenderWorkerConfigV2DTO> configs) {
|
||||
super(configs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getConfigKey(RenderWorkerConfigV2DTO config) {
|
||||
return config != null ? config.getConfigKey() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object getConfigValue(RenderWorkerConfigV2DTO config) {
|
||||
return config != null ? config.getConfigValue() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取渲染工作器配置类型
|
||||
*/
|
||||
public String getConfigType(String key) {
|
||||
RenderWorkerConfigV2DTO config = findConfigByKey(key);
|
||||
return config != null ? config.getConfigType() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取渲染工作器配置描述
|
||||
*/
|
||||
public String getConfigDescription(String key) {
|
||||
RenderWorkerConfigV2DTO config = findConfigByKey(key);
|
||||
return config != null ? config.getDescription() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取渲染工作器配置ID
|
||||
*/
|
||||
public Long getConfigId(String key) {
|
||||
RenderWorkerConfigV2DTO config = findConfigByKey(key);
|
||||
return config != null ? config.getId() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工作器ID
|
||||
*/
|
||||
public Long getWorkerId(String key) {
|
||||
RenderWorkerConfigV2DTO config = findConfigByKey(key);
|
||||
return config != null ? config.getWorkerId() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查配置是否启用
|
||||
*/
|
||||
public boolean isActive(String key) {
|
||||
RenderWorkerConfigV2DTO config = findConfigByKey(key);
|
||||
return config != null && config.getIsActive() != null && config.getIsActive() == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取配置的创建时间
|
||||
*/
|
||||
public String getCreateTime(String key) {
|
||||
RenderWorkerConfigV2DTO config = findConfigByKey(key);
|
||||
return config != null ? config.getCreateTime() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取配置的更新时间
|
||||
*/
|
||||
public String getUpdateTime(String key) {
|
||||
RenderWorkerConfigV2DTO config = findConfigByKey(key);
|
||||
return config != null ? config.getUpdateTime() : null;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user