master
luoyang 6 years ago
parent efd2185622
commit 94c1d06497

@ -120,9 +120,9 @@ public interface RetailAppService {
void useCoupon(JSONObject device, String coupon_log_id);
JSONObject getAd(JSONObject device);
JSONObject getAd();
JSONObject getAdDetail(JSONObject device, String article_id);
JSONObject getAdDetail(String article_id);
JSONObject getCheckClientInfo(JSONObject device);

@ -1765,13 +1765,10 @@ 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());
JSONObject getActs = acts.getJSONObject(selectNo);
getActs.put("ad_cover", getActs.getString("page_desc"));
@ -1793,9 +1790,7 @@ public class RetailAppServiceImp implements RetailAppService {
}
@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>";

@ -395,19 +395,6 @@ public class RetailAppController {
}
/* 优惠券End */
/**
* 广
*/
@RequestMapping(value = "/ads", method = RequestMethod.GET)
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);
}
@RequestMapping(value = "/bills/{bill_id}", method = RequestMethod.GET)
public JSONObject getBill(@PathVariable("bill_id") String bill_id, @ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return billService.getBillDetail(bill_id, device.getIntValue("client_id"));

@ -1,7 +1,9 @@
package au.com.royalpay.payment.manage.appclient.web;
import au.com.royalpay.payment.manage.appclient.beans.RetailLoginInfo;
import au.com.royalpay.payment.manage.appclient.core.RetailAppService;
import au.com.royalpay.payment.manage.signin.core.SignInStatusManager;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.device.DeviceSupport;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.http.HttpUtils;
@ -32,6 +34,8 @@ public class RetailValidationController {
private SignInStatusManager signInStatusManager;
@Resource
private DeviceSupport deviceSupport;
@Resource
private RetailAppService retailAppService;
@RequestMapping(value = "/devices/{devType}/register", method = RequestMethod.POST)
public JSONObject register(@RequestBody String registeration, @PathVariable String devType) {
@ -91,4 +95,17 @@ public class RetailValidationController {
}
return res;
}
/**
* 广
*/
@RequestMapping(value = "/ads", method = RequestMethod.GET)
public JSONObject getAd() {
return retailAppService.getAd();
}
@RequestMapping(value = "/ads/{article_id}", method = RequestMethod.GET)
public JSONObject getAdDetail(@PathVariable String article_id) {
return retailAppService.getAdDetail( article_id);
}
}

Loading…
Cancel
Save