1
This commit is contained in:
@@ -17,7 +17,7 @@ import com.jd.open.api.sdk.domain.kplunion.GoodsService.response.query.BigfieldQ
|
||||
import com.jd.open.api.sdk.domain.kplunion.GoodsService.response.query.GoodsQueryResult;
|
||||
import com.jd.open.api.sdk.domain.kplunion.GoodsService.response.query.UrlInfo;
|
||||
import com.jd.open.api.sdk.domain.kplunion.OrderService.request.query.OrderRowReq;
|
||||
import com.jd.open.api.sdk.domain.kplunion.promotioncommon.PromotionService.request.get.PromotionCodeReq;
|
||||
import com.jd.open.api.sdk.domain.kplunion.promotionbysubunioni.PromotionService.request.get.PromotionCodeReq;
|
||||
import com.jd.open.api.sdk.request.kplunion.*;
|
||||
import com.jd.open.api.sdk.response.kplunion.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -528,18 +528,17 @@ public class JDUtil {
|
||||
*/
|
||||
String transfer(String url) {
|
||||
JdClient client = new DefaultJdClient(SERVER_URL, ACCESS_TOKEN, LPF_APP_KEY_WZ, LPF_SECRET_KEY_WZ);
|
||||
UnionOpenPromotionCommonGetRequest request = new UnionOpenPromotionCommonGetRequest();
|
||||
PromotionCodeReq promotionCodeReq = new PromotionCodeReq();
|
||||
request.setPromotionCodeReq(promotionCodeReq);
|
||||
request.setVersion("1.0");
|
||||
promotionCodeReq.setMaterialId(url);
|
||||
|
||||
UnionOpenPromotionBysubunionidGetRequest request=new UnionOpenPromotionBysubunionidGetRequest();
|
||||
PromotionCodeReq promotionCodeReq=new PromotionCodeReq();
|
||||
promotionCodeReq.setSceneId(1);
|
||||
promotionCodeReq.setSiteId(LPF_WZ_ID);
|
||||
promotionCodeReq.setCommand(1);
|
||||
promotionCodeReq.setMaterialId(url);
|
||||
|
||||
request.setPromotionCodeReq(promotionCodeReq);
|
||||
|
||||
request.setVersion("1.0");
|
||||
logger.info("transfer - request {}", JSON.toJSONString(request));
|
||||
UnionOpenPromotionCommonGetResponse response;
|
||||
UnionOpenPromotionBysubunionidGetResponse response;
|
||||
try {
|
||||
response = client.execute(request);
|
||||
logger.info("transfer - response {}", JSON.toJSONString(response));
|
||||
@@ -567,7 +566,7 @@ public class JDUtil {
|
||||
String result = "";
|
||||
if (Util.isNotEmpty(response)) {
|
||||
if (response.getCode().equals("200")) {
|
||||
result = response.getGetResult().getData().getClickURL();
|
||||
result = response.getGetResult().getData().getShortURL();
|
||||
}
|
||||
} else {
|
||||
result = null;
|
||||
|
||||
Reference in New Issue
Block a user