eason.qian 7 years ago
parent 8827728559
commit 1dceaae57b

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

@ -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 = "<div style=\"padding:0 10px\"></div>";
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);

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

Loading…
Cancel
Save