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;
|
|
}
|
|
|
}
|