admin
2021-09-30 42411e4a26461229c6bca6e89ca55e98a80f5a4e
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java
@@ -714,27 +714,26 @@
    @RequestMapping(value = "getShowAd")
    public void showAd(AcceptData acceptData, Long uid, PrintWriter out) {
        String value = configService.getValue(ConfigKeyEnum.showSplashAd.getKey(), acceptData.getSystem());
        boolean huaweiShowAd = true;
        if ("huawei".equalsIgnoreCase(acceptData.getChannel())) {
            String version = configService.getValue(ConfigKeyEnum.huaweiOnLineVersionCode.getKey(), acceptData.getSystem());
            if (!StringUtil.isNullOrEmpty(version)) {
                if (Integer.parseInt(version) == Integer.parseInt(acceptData.getVersion())) {
                    huaweiShowAd = false;
                }
            }
        JSONObject configData = JSONObject.fromObject(value);
        String channel = acceptData.getChannel().toLowerCase();
        if (configData.optString(channel) == null) {
            channel = "qq";
        }
        int version = configData.optInt(channel);
        JSONObject data = new JSONObject();
        boolean show;
        if (Integer.parseInt(acceptData.getVersion()) >= version) {
            show = false;
        } else {
            show = true;
        }
        JSONObject data = new JSONObject();
        if ("0".equalsIgnoreCase(value.trim())) {
        if (show) {
            data.put("show", true);
            //加载广告数据
            data.put("ad", configService.getValue(ConfigKeyEnum.gdtAdInfo, acceptData.getSystem()));
        } else
            data.put("show", false);
        } else {
            if (huaweiShowAd) {
                data.put("show", true);
                //加载广告数据
                data.put("ad", configService.getValue(ConfigKeyEnum.gdtAdInfo, acceptData.getSystem()));
            } else
                data.put("show", false);
        }
        out.print(JsonUtil.loadTrueResult(data));
    }