admin
2022-08-25 264b5dea5b74c4b5ba54a90caba7e709858a037e
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
package com.yeshi.buwan.service.manager;
 
import com.yeshi.buwan.service.imp.DetailSystemConfigService;
import com.yeshi.buwan.util.StringUtil;
import org.json.JSONObject;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
 
/**
 * @author hxh
 * @title: APPManager
 * @description: TODO
 * @date 2021/12/24 17:21
 */
@Component
public class APPManager {
 
    @Resource
    private DetailSystemConfigService configService;
 
 
    public boolean isOnline(String detailSystemId, int version, String channel) {
 
        String result = configService.getConfigValueByKey("online_versions", detailSystemId, version);
        if (!StringUtil.isNullOrEmpty(result)) {
            JSONObject json = new JSONObject(result);
            if (json.optInt(channel.toLowerCase(), Integer.MAX_VALUE) <= version) {
                return true;
            }
        }
        return false;
 
    }
 
 
}