mirror of https://gitee.com/stylefeng/roses
【7.6.0】【config】简化config接口
parent
0a988d6133
commit
6881c5eeb4
|
@ -60,16 +60,4 @@ public class SystemConfigController {
|
||||||
return new SuccessResponseData<>(sysConfigService.getInitConfigs());
|
return new SuccessResponseData<>(sysConfigService.getInitConfigs());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取后端服务部署的地址
|
|
||||||
*
|
|
||||||
* @author fengshuonan
|
|
||||||
* @since 2021/7/8 16:36
|
|
||||||
*/
|
|
||||||
@GetResource(name = "获取后端服务部署的地址", path = "/sysConfig/getBackendDeployUrl", requiredLogin = false)
|
|
||||||
public ResponseData<String> getBackendDeployUrl() {
|
|
||||||
String serverDeployHost = sysConfigService.getServerDeployHost();
|
|
||||||
return new SuccessResponseData<>(serverDeployHost);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,11 +103,4 @@ public interface SysConfigService extends IService<SysConfig>, InitConfigApi {
|
||||||
*/
|
*/
|
||||||
InitConfigResponse getInitConfigs();
|
InitConfigResponse getInitConfigs();
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取后端部署的地址
|
|
||||||
*
|
|
||||||
* @author fengshuonan
|
|
||||||
* @since 2022/3/3 14:23
|
|
||||||
*/
|
|
||||||
String getServerDeployHost();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,6 @@ import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.extra.spring.SpringUtil;
|
import cn.hutool.extra.spring.SpringUtil;
|
||||||
import cn.stylefeng.roses.kernel.config.api.ConfigInitCallbackApi;
|
import cn.stylefeng.roses.kernel.config.api.ConfigInitCallbackApi;
|
||||||
import cn.stylefeng.roses.kernel.config.api.ConfigInitStrategyApi;
|
import cn.stylefeng.roses.kernel.config.api.ConfigInitStrategyApi;
|
||||||
import cn.stylefeng.roses.kernel.config.api.constants.ConfigConstants;
|
|
||||||
import cn.stylefeng.roses.kernel.config.api.context.ConfigContext;
|
import cn.stylefeng.roses.kernel.config.api.context.ConfigContext;
|
||||||
import cn.stylefeng.roses.kernel.config.api.exception.ConfigException;
|
import cn.stylefeng.roses.kernel.config.api.exception.ConfigException;
|
||||||
import cn.stylefeng.roses.kernel.config.api.exception.enums.ConfigExceptionEnum;
|
import cn.stylefeng.roses.kernel.config.api.exception.enums.ConfigExceptionEnum;
|
||||||
|
@ -252,21 +251,6 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
||||||
return initConfigResponse;
|
return initConfigResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getServerDeployHost() {
|
|
||||||
|
|
||||||
// 获取后端部署的服务器
|
|
||||||
LambdaQueryWrapper<SysConfig> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
wrapper.eq(SysConfig::getConfigCode, ConfigConstants.SYS_SERVER_DEPLOY_HOST);
|
|
||||||
SysConfig sysConfig = this.getOne(wrapper, false);
|
|
||||||
|
|
||||||
if (sysConfig != null) {
|
|
||||||
return sysConfig.getConfigValue();
|
|
||||||
} else {
|
|
||||||
return RuleConstants.DEFAULT_SERVER_DEPLOY_HOST;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取系统参数配置
|
* 获取系统参数配置
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue