Search in sources :

Example 1 with SystemInfo

use of com.ctrip.framework.apollo.portal.entity.vo.SystemInfo in project apollo by ctripcorp.

the class SystemInfoController method getSystemInfo.

@PreAuthorize(value = "@permissionValidator.isSuperAdmin()")
@GetMapping
public SystemInfo getSystemInfo() {
    SystemInfo systemInfo = new SystemInfo();
    String version = Apollo.VERSION;
    if (isValidVersion(version)) {
        systemInfo.setVersion(version);
    }
    List<Env> allEnvList = portalSettings.getAllEnvs();
    for (Env env : allEnvList) {
        EnvironmentInfo environmentInfo = adaptEnv2EnvironmentInfo(env);
        systemInfo.addEnvironment(environmentInfo);
    }
    return systemInfo;
}
Also used : SystemInfo(com.ctrip.framework.apollo.portal.entity.vo.SystemInfo) EnvironmentInfo(com.ctrip.framework.apollo.portal.entity.vo.EnvironmentInfo) Env(com.ctrip.framework.apollo.portal.environment.Env) GetMapping(org.springframework.web.bind.annotation.GetMapping) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize)

Aggregations

EnvironmentInfo (com.ctrip.framework.apollo.portal.entity.vo.EnvironmentInfo)1 SystemInfo (com.ctrip.framework.apollo.portal.entity.vo.SystemInfo)1 Env (com.ctrip.framework.apollo.portal.environment.Env)1 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1