mirror of https://gitee.com/stylefeng/roses
【7.6.0】【config】切分系统配置接口
parent
c850539720
commit
e3ab71498d
|
@ -24,9 +24,7 @@
|
||||||
*/
|
*/
|
||||||
package cn.stylefeng.roses.kernel.config.modular.controller;
|
package cn.stylefeng.roses.kernel.config.modular.controller;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.config.api.pojo.ConfigInitRequest;
|
|
||||||
import cn.stylefeng.roses.kernel.config.modular.entity.SysConfig;
|
import cn.stylefeng.roses.kernel.config.modular.entity.SysConfig;
|
||||||
import cn.stylefeng.roses.kernel.config.modular.pojo.InitConfigResponse;
|
|
||||||
import cn.stylefeng.roses.kernel.config.modular.pojo.param.SysConfigParam;
|
import cn.stylefeng.roses.kernel.config.modular.pojo.param.SysConfigParam;
|
||||||
import cn.stylefeng.roses.kernel.config.modular.service.SysConfigService;
|
import cn.stylefeng.roses.kernel.config.modular.service.SysConfigService;
|
||||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||||
|
@ -40,16 +38,15 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数配置控制器
|
* 配置管理界面的接口
|
||||||
*
|
*
|
||||||
* @author stylefeng
|
* @author fengshuonan
|
||||||
* @since 2020/4/13 22:46
|
* @since 2023/6/27 21:33
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@ApiResource(name = "参数配置控制器")
|
@ApiResource(name = "配置管理界面的接口")
|
||||||
public class SysConfigController {
|
public class SysConfigController {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
|
@ -102,7 +99,6 @@ public class SysConfigController {
|
||||||
return new SuccessResponseData<>(sysConfigService.detail(sysConfigParam));
|
return new SuccessResponseData<>(sysConfigService.detail(sysConfigParam));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询配置列表
|
* 分页查询配置列表
|
||||||
*
|
*
|
||||||
|
@ -114,63 +110,6 @@ public class SysConfigController {
|
||||||
return new SuccessResponseData<>(sysConfigService.findPage(sysConfigParam));
|
return new SuccessResponseData<>(sysConfigService.findPage(sysConfigParam));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统参数配置列表
|
|
||||||
*
|
|
||||||
* @author fengshuonan
|
|
||||||
* @since 2020/4/14 11:10
|
|
||||||
*/
|
|
||||||
@GetResource(name = "系统参数配置列表", path = "/sysConfig/list")
|
|
||||||
public ResponseData<List<SysConfig>> list(SysConfigParam sysConfigParam) {
|
|
||||||
return new SuccessResponseData<>(sysConfigService.findList(sysConfigParam));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取系统配置是否初始化的标志
|
|
||||||
*
|
|
||||||
* @author fengshuonan
|
|
||||||
* @since 2021/7/8 17:20
|
|
||||||
*/
|
|
||||||
@GetResource(name = "获取系统配置是否初始化的标志", path = "/sysConfig/getInitConfigFlag")
|
|
||||||
public ResponseData<Boolean> getInitConfigFlag() {
|
|
||||||
return new SuccessResponseData<>(sysConfigService.getInitConfigFlag());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 初始化系统配置参数,用在系统第一次登录时
|
|
||||||
*
|
|
||||||
* @author fengshuonan
|
|
||||||
* @since 2021/7/8 16:36
|
|
||||||
*/
|
|
||||||
@PostResource(name = "初始化系统配置参数,用在系统第一次登录时", path = "/sysConfig/initConfig")
|
|
||||||
public ResponseData<?> initConfig(@RequestBody ConfigInitRequest configInitRequest) {
|
|
||||||
sysConfigService.initConfig(configInitRequest);
|
|
||||||
return new SuccessResponseData<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取需要初始化的配置列表
|
|
||||||
*
|
|
||||||
* @author fengshuonan
|
|
||||||
* @since 2021/7/8 16:36
|
|
||||||
*/
|
|
||||||
@GetResource(name = "获取需要初始化的配置列表", path = "/sysConfig/getInitConfigList")
|
|
||||||
public ResponseData<InitConfigResponse> getInitConfigList() {
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
package cn.stylefeng.roses.kernel.config.modular.controller;
|
||||||
|
|
||||||
|
import cn.stylefeng.roses.kernel.config.api.pojo.ConfigInitRequest;
|
||||||
|
import cn.stylefeng.roses.kernel.config.modular.pojo.InitConfigResponse;
|
||||||
|
import cn.stylefeng.roses.kernel.config.modular.service.SysConfigService;
|
||||||
|
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
||||||
|
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
||||||
|
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||||
|
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||||
|
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前端框架对系统配置的调用接口
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @since 2023/6/27 21:33
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@ApiResource(name = "前端框架对系统配置的调用接口")
|
||||||
|
public class SystemConfigController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SysConfigService sysConfigService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取系统配置是否初始化的标志
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @since 2021/7/8 17:20
|
||||||
|
*/
|
||||||
|
@GetResource(name = "获取系统配置是否初始化的标志", path = "/sysConfig/getInitConfigFlag")
|
||||||
|
public ResponseData<Boolean> getInitConfigFlag() {
|
||||||
|
return new SuccessResponseData<>(sysConfigService.getInitConfigFlag());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化系统配置参数,用在系统第一次登录时
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @since 2021/7/8 16:36
|
||||||
|
*/
|
||||||
|
@PostResource(name = "初始化系统配置参数,用在系统第一次登录时", path = "/sysConfig/initConfig")
|
||||||
|
public ResponseData<?> initConfig(@RequestBody ConfigInitRequest configInitRequest) {
|
||||||
|
sysConfigService.initConfig(configInitRequest);
|
||||||
|
return new SuccessResponseData<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取需要初始化的配置列表
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @since 2021/7/8 16:36
|
||||||
|
*/
|
||||||
|
@GetResource(name = "获取需要初始化的配置列表", path = "/sysConfig/getInitConfigList")
|
||||||
|
public ResponseData<InitConfigResponse> getInitConfigList() {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue