package com.yeshi.buwan.util.config;
|
|
import com.yeshi.buwan.util.StringUtil;
|
import net.sf.json.JSONObject;
|
|
/**
|
* @author hxh
|
* @title: SystemConfigUtil
|
* @description: 系统配置工具
|
* @date 2024/9/3 14:23
|
*/
|
public class SystemConfigUtil {
|
|
/**
|
* @author hxh
|
* @description 是否是首次上线
|
* @date 14:25 2024/9/3
|
* @param: configValue
|
* @param: channel
|
* @param: versionCode
|
* @return boolean
|
**/
|
public static boolean isFirstOnLine(String configValue, String channel, int versionCode) {
|
if(!StringUtil.isNullOrEmpty(configValue)) {
|
JSONObject firstOnLineValueObj = JSONObject.fromObject(configValue);
|
if (firstOnLineValueObj != null) {
|
firstOnLineValueObj = firstOnLineValueObj.optJSONObject(channel.toLowerCase());
|
if (firstOnLineValueObj != null && firstOnLineValueObj.optInt("version") == versionCode) {
|
return true;
|
}
|
}
|
}
|
return false;
|
}
|
|
}
|