ServiceEnvConfig.java 735 Bytes
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("${uc.service.type: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);
    }

}