admin
2024-09-05 ab35ac8b769b2d9816dffb33a64f2c6f7bd5dd6e
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
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;
    }
 
}