ServiceEnvConfig.java
1.23 KB
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
41
42
43
package com.topdraw.config;
import cn.hutool.core.util.ObjectUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class ServiceEnvConfig {
// uc两侧部署,需配置位于哪一侧 mobile小屏侧 vis大屏侧
public static String UC_SERVICE_TYPE;
@Value("${service.area:mobile}")
public void setUcServiceType(String ucServiceType) {
UC_SERVICE_TYPE = ucServiceType;
}
public static boolean isMobile() {
return ObjectUtil.equals(UC_SERVICE_TYPE, LocalConstants.ENV_MOBILE);
}
public static boolean isVis() {
return ObjectUtil.equals(UC_SERVICE_TYPE, LocalConstants.ENV_VIS);
}
// service: 服务侧 management: 管理侧
public static String UC_SERVICE_PLATFORM;
@Value("${service.platform:management}")
public void setUcServicePlatform(String ucServicePlatform) {
UC_SERVICE_PLATFORM = ucServicePlatform;
}
public static boolean isService() {
return ObjectUtil.equals(UC_SERVICE_PLATFORM, LocalConstants.ENV_SERVICE);
}
public static boolean isManagement() {
return ObjectUtil.equals(UC_SERVICE_PLATFORM, LocalConstants.ENV_MANAGEMENT);
}
}