|
|
|
@ -1770,23 +1770,34 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject getAd(JSONObject device) {
|
|
|
|
|
String clientType = device.getString("client_type");
|
|
|
|
|
deviceSupport.findRegister(clientType);
|
|
|
|
|
public JSONObject getAd() {
|
|
|
|
|
JSONObject res = royalPayCMSSupport.listArticles("app_ad", false, true, 1, 10);
|
|
|
|
|
JSONArray acts = res.getJSONArray("data");
|
|
|
|
|
if (acts.size() > 0) {
|
|
|
|
|
int selectNo = RandomUtils.nextInt(0, acts.size());
|
|
|
|
|
return acts.getJSONObject(selectNo);
|
|
|
|
|
JSONObject getActs = acts.getJSONObject(selectNo);
|
|
|
|
|
getActs.put("ad_cover", getActs.getString("page_desc"));
|
|
|
|
|
getActs.put("ad_mode", getActs.getString("page_keywords"));
|
|
|
|
|
getActs.put("ad_link", getActs.getString("summery"));
|
|
|
|
|
getActs.put("publish_date", DateFormatUtils.format(getActs.getDate("publish_time"),"yyyy/MM/dd HH:mm:ss"));
|
|
|
|
|
String reference = getActs.getString("reference");
|
|
|
|
|
JSONObject referenceObj = JSONObject.parseObject(reference);
|
|
|
|
|
getActs.put("ad_type", referenceObj.getString("ad_type"));
|
|
|
|
|
getActs.put("expire_date", referenceObj.getString("expire_date"));
|
|
|
|
|
getActs.put("duration_time", referenceObj.getString("duration_time"));
|
|
|
|
|
getActs.remove("reference");
|
|
|
|
|
getActs.remove("page_desc");
|
|
|
|
|
getActs.remove("page_keywords");
|
|
|
|
|
getActs.remove("summery");
|
|
|
|
|
getActs.remove("publish_time");
|
|
|
|
|
return getActs;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject getAdDetail(JSONObject device, String article_id) {
|
|
|
|
|
String clientType = device.getString("client_type");
|
|
|
|
|
deviceSupport.findRegister(clientType);
|
|
|
|
|
public JSONObject getAdDetail(String article_id) {
|
|
|
|
|
JSONObject res = royalPayCMSSupport.getArticle("app_ad", article_id);
|
|
|
|
|
Document doc = Jsoup.parse(res.getString("content"));
|
|
|
|
|
String father = "<div style=\"padding:0 10px\"></div>";
|
|
|
|
|