From 77e706cca33c97a4428879cc9a6f98aae085c142 Mon Sep 17 00:00:00 2001 From: admin <2780501319@qq.com> Date: 星期六, 24 四月 2021 00:35:13 +0800 Subject: [PATCH] 0元购完善 --- src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java b/src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java index 4d60e6c..b804e7c 100644 --- a/src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java +++ b/src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java @@ -330,6 +330,28 @@ homeType.setHomeVideoList(tempHomeVideoList); } + try { + if (VersionUtil.isGraterThan387(acceptData.getPlatform(), acceptData.getVersion()) && dataKey.equalsIgnoreCase("recommend")) { + DetailSystemConfig adContent = configService.getConfigByKey("home_banner_ad_content", acceptData.getDetailSystem(), acceptData.getVersion()); + DetailSystemConfig adPosition = configService.getConfigByKey("home_banner_ad_position", acceptData.getDetailSystem(), acceptData.getVersion()); + if (adContent != null && adPosition != null) { + HomeType.HomeTypeAd ad = new Gson().fromJson(adContent.getValue(), HomeType.HomeTypeAd.class); + int adP = Integer.parseInt(adPosition.getValue()); + if (adP < homeTypeList.size() && adP > -1) { + HomeType homeType = new HomeType(); + homeType.setAd(ad); + if ("1".equalsIgnoreCase(page)) { + homeTypeList.add(adP, homeType); + } + count++; + } + } + } + } catch (Exception e) { + + } + + JSONObject object = new JSONObject(); JSONArray array = new JSONArray(); for (int i = 0; i < homeTypeList.size(); i++) -- Gitblit v1.8.0