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.promotionbysubunioni.PromotionService.request.get.PromotionCodeReq;
|
||||
import com.jd.open.api.sdk.domain.kplunion.promotioncommon.PromotionService.request.get.PromotionCodeReq;
|
||||
import com.jd.open.api.sdk.request.kplunion.*;
|
||||
import com.jd.open.api.sdk.response.kplunion.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -65,6 +65,7 @@ public class JDUtil {
|
||||
// van论坛
|
||||
private static final String LPF_APP_KEY_WZ = "98e21c89ae5610240ec3f5f575f86a59";
|
||||
private static final String LPF_SECRET_KEY_WZ = "3dcb6b23a1104639ac433fd07adb6dfb";
|
||||
private static final String LPF_WZ_ID = "4101253066";
|
||||
// 导购的
|
||||
private static final String LPF_APP_KEY_DG = "faf410cb9587dc80dc7b31e321d7d322";
|
||||
private static final String LPF_SECRET_KEY_DG = "a4fb15d7bedd4316b97b4e96e4effc1c";
|
||||
@@ -526,17 +527,22 @@ public class JDUtil {
|
||||
* jd.union.open.promotion.bysubunionid.get
|
||||
*/
|
||||
String transfer(String url) {
|
||||
JdClient client = new DefaultJdClient(SERVER_URL, ACCESS_TOKEN, LPF_APP_KEY_DG, LPF_SECRET_KEY_DG);
|
||||
|
||||
UnionOpenPromotionBysubunionidGetRequest request = new UnionOpenPromotionBysubunionidGetRequest();
|
||||
JdClient client = new DefaultJdClient(SERVER_URL, ACCESS_TOKEN, LPF_APP_KEY_WZ, LPF_SECRET_KEY_WZ);
|
||||
UnionOpenPromotionCommonGetRequest request = new UnionOpenPromotionCommonGetRequest();
|
||||
PromotionCodeReq promotionCodeReq = new PromotionCodeReq();
|
||||
promotionCodeReq.setMaterialId(url);
|
||||
promotionCodeReq.setSceneId(1);
|
||||
request.setPromotionCodeReq(promotionCodeReq);
|
||||
request.setVersion("1.0");
|
||||
UnionOpenPromotionBysubunionidGetResponse response = null;
|
||||
promotionCodeReq.setMaterialId(url);
|
||||
promotionCodeReq.setSceneId(1);
|
||||
promotionCodeReq.setSiteId(LPF_WZ_ID);
|
||||
promotionCodeReq.setCommand(1);
|
||||
request.setPromotionCodeReq(promotionCodeReq);
|
||||
request.setVersion("1.0");
|
||||
logger.info("transfer - request {}", JSON.toJSONString(request));
|
||||
UnionOpenPromotionCommonGetResponse response;
|
||||
try {
|
||||
response = client.execute(request);
|
||||
logger.info("transfer - response {}", JSON.toJSONString(response));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -561,7 +567,7 @@ public class JDUtil {
|
||||
String result = "";
|
||||
if (Util.isNotEmpty(response)) {
|
||||
if (response.getCode().equals("200")) {
|
||||
result = response.getGetResult().getData().getShortURL();
|
||||
result = response.getGetResult().getData().getClickURL();
|
||||
}
|
||||
} else {
|
||||
result = null;
|
||||
|
||||
Reference in New Issue
Block a user