liujie
2026-08-11 323764c813a09cd56cdab780155ef659dbe0b364
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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);
    }
}