package com.ruoyi.web.controller.api;
|
|
import com.ruoyi.common.annotation.Anonymous;
|
import com.ruoyi.common.config.RuoYiConfig;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.system.vo.SysDeploymentConfigVO;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
/**
|
* 部署配置接口
|
*
|
* @author ruoyi
|
*/
|
@Anonymous
|
@RestController
|
@RequestMapping("/api/deployment")
|
public class SysDeploymentConfigController
|
{
|
@Autowired
|
private RuoYiConfig ruoyiConfig;
|
|
/**
|
* 查询部署配置
|
*/
|
@GetMapping("/config")
|
public AjaxResult config()
|
{
|
SysDeploymentConfigVO vo = new SysDeploymentConfigVO();
|
boolean cluster = ruoyiConfig.isClusterMode();
|
vo.setDeploymentMode(cluster ? "cluster" : "standalone");
|
vo.setStandalone(!cluster);
|
vo.setCluster(cluster);
|
vo.setRequireServerIp(!cluster);
|
vo.setMiddlePlatformEnabled(ruoyiConfig.isConnectMiddlePlatform());
|
return AjaxResult.success(vo);
|
}
|
}
|