diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java index 1779af0b5..108d09593 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java @@ -107,4 +107,6 @@ public interface RetailAppService { void useCoupon(JSONObject device, String coupon_log_id); JSONObject getAd(JSONObject device); + + JSONObject getAdDetail(JSONObject device, String article_id); } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index a8655bcf2..527c3da61 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -1187,6 +1187,19 @@ public class RetailAppServiceImp implements RetailAppService { } + @Override + public JSONObject getAdDetail(JSONObject device, String article_id) { + String clientType = device.getString("client_type"); + deviceSupport.findRegister(clientType); + JSONObject res = royalPayCMSSupport.getArticle("app_ad", article_id); + Document doc = Jsoup.parse(res.getString("content")); + String father = "
"; + String html = doc.body().children().wrap(father).html(); + res.put("content", doc.html()); + res.put("publish_time_format", TimeZoneUtils.formatTime(res.getDate("publish_time"), "yyyy-MM-dd HH:mm:ss", "Australia/Melbourne")); + return res; + } + private static boolean mathchLetterorNum(String str) { String regex = "[A-Za-z0-9]{8}"; return str.matches(regex); diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java index bb679fd4a..670682d8f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java @@ -272,7 +272,11 @@ public class RetailAppController { * 广告位 */ @RequestMapping(value = "/ads", method = RequestMethod.GET) - public JSONObject getActivities(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { + public JSONObject getAd(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { return retailAppService.getAd(device); } + @RequestMapping(value = "/ads/{article_id}", method = RequestMethod.GET) + public JSONObject getAdDetail(@PathVariable String article_id,@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { + return retailAppService.getAdDetail(device,article_id); + } }