2025-02-28 17:56:48 +08:00
|
|
|
package io.gisbi.utils;
|
2025-02-27 14:44:08 +08:00
|
|
|
|
2025-02-28 17:56:48 +08:00
|
|
|
import io.gisbi.model.DeModel;
|
2025-02-27 14:44:08 +08:00
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
@Component
|
|
|
|
public class ModelUtils {
|
|
|
|
|
|
|
|
private static String modelValue;
|
|
|
|
|
|
|
|
@Value("${spring.profiles.active:standalone}")
|
|
|
|
public void setModelValue(String modelValue) {
|
|
|
|
ModelUtils.modelValue = modelValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static DeModel get() {
|
|
|
|
return DeModel.valueOf(modelValue.toUpperCase());
|
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean isDesktop() {
|
|
|
|
return get() == DeModel.DESKTOP;
|
|
|
|
}
|
|
|
|
}
|