
完整的第三方服务集成方案 | 电商联盟 | 支付渠道 | 云服务
集成说明: 大淘客 API 作为淘宝联盟的第三方服务商,提供商品查询、转链、订单同步等能力。
接口名称 | 方法 | API 路径 | 说明 |
|---|---|---|---|
商品列表 | GET | /goods/list | 获取淘宝商品列表 |
商品搜索 | GET | /goods/search | 关键词搜索商品 |
商品详情 | GET | /goods/detail | 获取商品详细信息 |
推广文案 | GET | /goods/word | 生成淘口令/推广链接 |
链接解析 | GET | /goods/parse | 解析淘宝链接获取商品信息 |
相似商品 | GET | /goods/similar | 获取相似商品推荐 |
商品分类 | GET | /goods/category | 获取商品分类数据 |
排行榜 | GET | /goods/rank | 获取热销排行榜 |
订单查询 | GET | /order/query | 同步淘宝订单数据 |
服务类: DataokeService.java
@Component
public class DataokeService {
@Resource
private DataokeConfig config;
// 商品搜索
public JSONObject goodsSearch(GoodsSearchParam param) {
TreeMap<String, Object> paraMap = JSON.parseObject(
JSON.toJSONString(param), mapTypeReference);
String data = getData(
DataokeApi.TB_SEARCH.getUrl(),
DataokeApi.TB_SEARCH.getVersion(),
paraMap);
return JSON.parseObject(data);
}
// 生成推广文案
public JSONObject goodsWord(String goodsId, String pid, String channelId) {
TreeMap<String, Object> paraMap = new TreeMap<>();
paraMap.put("goodsId", goodsId);
if(StringUtils.isNotBlank(pid)) {
paraMap.put("pid", pid);
}
if(StringUtils.isNotBlank(channelId)) {
paraMap.put("channelId", channelId);
}
String data = getData(
DataokeApi.GOODS_WORD.getUrl(),
DataokeApi.GOODS_WORD.getVersion(),
paraMap);
return JSON.parseObject(data);
}
// 链接解析
public DataokeResVo<GoodsParseVo> goodsParse(String content, String pid, String channelId) {
TreeMap<String, Object> paraMap = new TreeMap<>();
paraMap.put("content", content);
if(StringUtils.isNotBlank(pid)) {
paraMap.put("pid", pid);
}
String data = getData(
DataokeApi.GOODS_PARSE.getUrl(),
DataokeApi.GOODS_PARSE.getVersion(),
paraMap);
return JSON.parseObject(data, goodsParseTypeRef);
}
}配置类: DataokeConfig.java
@Component
@Data
public class DataokeConfig {
@Value("${dataoke.key}")
private String key;
@Value("${dataoke.secret}")
private String secret;
}配置文件:
# application-dev.yml
dataoke:
key: xxxxxxeb094a5
secret: xxxxxxcee4a4b9579561ec0722cbd734
cmsUrl: https://cmscg.dataoke.com/cms-v2
apiUrl: https://openapi.dataoke.com/api
1.2 京东联盟
集成说明: 通过大淘客 API 集成京东联盟,支持商品搜索、详情获取、转链等功能。
接口名称 | 方法 | API 路径 | 说明 |
|---|---|---|---|
商品详情 | GET | /jd/goods/detail | 获取京东商品详情 |
推广文案 | GET | /jd/goods/word | 生成京东推广链接 |
链接解析 | GET | /jd/parse/url | 解析京东链接 |
订单查询 | GET | /jd/order/query | 同步京东订单数据 |
// 京东商品详情
public JSONObject goodsDetailJD(String goodsId, String itemId) {
TreeMap<String, Object> paraMap = new TreeMap<>();
if(StringUtils.isNotBlank(goodsId) && !"0".equals(goodsId)) {
paraMap.put("skuIds", goodsId);
}
if(StringUtils.isNotBlank(itemId)) {
paraMap.put("itemIds", itemId);
}
String data = getData(
DataokeApi.JD_GOODS_DETAIL.getUrl(),
DataokeApi.JD_GOODS_DETAIL.getVersion(),
paraMap);
return JSON.parseObject(data);
}
// 生成京东转链
public JSONObject goodsWordJD(String itemUrl, String couponUrl, String pid) {
TreeMap<String, Object> paraMap = new TreeMap<>();
paraMap.put("materialId", itemUrl);
if(StringUtils.isNotBlank(couponUrl)) {
paraMap.put("couponUrl", couponUrl);
}
if(pid != null) {
paraMap.put("positionId", pid);
}
paraMap.put("unionId", jdConfig.getUnionId());
String data = getData(
DataokeApi.JD_GOODS_WORD.getUrl(),
DataokeApi.JD_GOODS_WORD.getVersion(),
paraMap);
return JSON.parseObject(data);
}配置:
# 京东联盟配置
pdd:
clientId: xxxxxxe0e3b94b52828xxxxxxe9c0f
clientSecret: xxxxxxa8e131687f1aac5af282xxxxxx99c92639
pid: 1784892_252288888集成说明: 集成拼多多联盟 API,支持商品搜索、详情、转链、订单同步。
接口名称 | 方法 | API 路径 | 说明 |
|---|---|---|---|
商品列表 | GET | /pdd/goods/list | 获取拼多多商品列表 |
商品搜索 | GET | /pdd/goods/search | 关键词搜索商品 |
商品详情 | GET | /pdd/goods/detail | 获取商品详细信息 |
推广文案 | GET | /pdd/goods/word | 生成拼多多推广链接 |
商品分类 | GET | /pdd/goods/cate | 获取商品分类 |
订单查询 | GET | /pdd/order/query | 同步拼多多订单 |
// 拼多多商品搜索
public PddSearchListVO goodsListPdd(GoodsListPddParam param) {
TreeMap<String, Object> paraMap = JSON.parseObject(
JSON.toJSONString(param), mapTypeReference);
String data = getData(
DataokeApi.PDD_GOODS_SEARCH.getUrl(),
DataokeApi.PDD_GOODS_SEARCH.getVersion(),
paraMap);
return JSON.parseObject(data, PddSearchListVO.class);
}
// 生成拼多多转链
public JSONObject goodsWordPDD(String goodsSign, Long uid) {
TreeMap<String, Object> paraMap = new TreeMap<>();
paraMap.put("pid", pddConfig.getPid());
paraMap.put("goodsSign", goodsSign);
if(uid != null) {
int auth = pddService.authQuery(uid);
if(auth == 1) {
paraMap.put("customParameters", pddConfig.getParam(uid));
}
}
String data = getData(
DataokeApi.PDD_GOODS_WORD.getUrl(),
DataokeApi.PDD_GOODS_WORD.getVersion(),
paraMap);
return JSON.parseObject(data);
}集成说明: 集成抖音电商 API,支持商品搜索、详情、转链等功能。
接口名称 | 方法 | API 路径 | 说明 |
|---|---|---|---|
商品搜索 | GET | /dy/goods/search | 搜索抖音商品 |
商品详情 | GET | /dy/goods/detail | 获取商品详情 |
推广文案 | GET | /dy/word | 生成抖音推广链接 |
订单查询 | GET | /dy/order/query | 同步抖音订单 |
// 抖音商品搜索
public JSONObject dyGoodsSearch(GoodsSearchDyParam param) {
if(StringUtils.isNotBlank(param.getTitle())) {
String keyWord = param.getTitle().toLowerCase();
if(TkUtil.hasWord(keyWord) || EXCLUDE_KEY_WROD_LIST.contains(keyWord)){
JSONObject res = new JSONObject();
JSONObject data = new JSONObject();
data.put("list", new JSONArray());
data.put("total", 0);
res.put("data", data);
return res;
}
}
param.setAppkey(config.getKey());
TreeMap<String, Object> paraMap = JSON.parseObject(
JSON.toJSONString(param), mapTypeReference);
String data = getData(
DataokeApi.DY_GOODS_SEARCH.getUrl(),
DataokeApi.DY_GOODS_SEARCH.getVersion(),
paraMap);
return JSON.parseObject(data);
}
// 抖音转链
public JSONObject dyWord(String productUrl, String externalInfo) {
TreeMap<String, Object> paraMap = new TreeMap<>();
paraMap.put("productUrl", productUrl);
paraMap.put("externalInfo", externalInfo);
String data = getData(
DataokeApi.DY_WORD.getUrl(),
DataokeApi.DY_WORD.getVersion(),
paraMap);
return JSON.parseObject(data);
}集成说明: 集成唯品会 API,支持商品搜索、详情、转链、订单同步。
接口名称 | 方法 | API 路径 | 说明 |
|---|---|---|---|
商品列表 | GET | /vip/goods/list | 获取唯品会商品列表 |
商品搜索 | GET | /vip/goods/search | 搜索唯品会商品 |
商品详情 | GET | /vip/goods/detail | 获取商品详情 |
推广文案 | GET | /vip/goods/word | 生成唯品会推广链接 |
订单查询 | GET | /vip/order/query | 同步唯品会订单 |
// 唯品会商品详情
public VipGoodsDetailDataVo goodsDetailVIP(String goodsId, String openId) {
TreeMap<String, Object> paraMap = new TreeMap<>();
paraMap.put("goodsIdList", "[\"" + goodsId + "\"]");
JSONObject request = new JSONObject();
request.put("openId", openId);
request.put("realCall", "true");
paraMap.put("request", request.toJSONString());
String data = getData(
DataokeApi.VIP_GOODS_DETAIL.getUrl(),
DataokeApi.VIP_GOODS_DETAIL.getVersion(),
paraMap);
VipGoodsDetailDataVo dataVo = JSON.parseObject(data, VipGoodsDetailDataVo.class);
return dataVo;
}
// 唯品会转链
public VipWordCodeVO goodsWordVIP(String itemUrl, String statParam, JSONObject urlGenRequest) {
TreeMap<String, Object> paraMap = new TreeMap<>();
paraMap.put("urlList", "[\"" + itemUrl + "\"]");
if(StringUtils.isNotBlank(statParam)) {
paraMap.put("statParam", statParam);
}
paraMap.put("urlGenRequest", urlGenRequest.toJSONString());
String data = getData(
DataokeApi.VIP_GOODS_WORD.getUrl(),
DataokeApi.VIP_GOODS_WORD.getVersion(),
paraMap);
VipWordCodeVO codeVO = JSON.parseObject(data, VipWordCodeVO.class);
return codeVO;
}集成说明: 集成美团联盟 API,支持商品查询、订单同步等功能。
服务类: MeituanService.java
@Component
@Slf4j
public class MeituanService {
private final static String HOST = "media.meituan.com";
@Resource
private MeituanConfig meituanConfig;
@Resource
private RestTemplate restTemplate;
// 商品列表
public JSONObject goodsList(MeituanGoodsParam param){
String path = "/cps_open/common/api/v1/query_coupon";
return requestMeituan(param, path);
}
// 订单查询
public MtResVo order(MeituanOrderParam param){
String path = "/cps_open/common/api/v1/query_order";
JSONObject res = requestMeituan(param, path);
// 处理返回数据...
return resVo;
}
// 获取推广链接
public JSONObject getCode(MeituanLinkParam param, Long uid) throws Exception {
String path = "/cps_open/common/api/v1/get_referral_link";
param.setSid("MT_MEDIUM_PREFIX" + uid);
return requestMeituan(param, path);
}
// 统一请求方法
public JSONObject requestMeituan(MeituanBaseParam param, String path) throws Exception {
return restTemplate.postForObject(
"https://" + HOST + path,
param,
JSONObject.class);
}
}集成说明: 通过好单库集成饿了么 API,支持商品查询、订单同步。
# 好单库配置
haodanku:
key: xxxxxxE08805
waimaiKey: xxxxxxE08805
vip:
appId: xxxxxx66
appSecret: xxxxxxa8531d98c0041cb41435866da7集成说明: 集成支付宝 APP 支付、网页支付、转账等功能。
功能 | 说明 |
|---|---|
APP 支付 | 支付宝客户端支付 |
网页支付 | H5 页面支付 |
转账到银行卡 | 用户提现 |
回调通知 | 支付结果异步通知 |
服务类: AliPayService.java
@Component
@Slf4j
public class AliPayService extends PayService {
@Resource
private AlipayConfigService alipayConfigService;
// APP 支付
public Map<String, String> alipay(PayChannelDto payChannelDto,
String orderId,
String price) throws Exception {
AlipayConfig alipay = parseAliPayConfig(payChannelDto);
TradeVo trade = new TradeVo();
trade.setTotalAmount(price);
trade.setOutTradeNo(orderId);
trade.setSubject(payConfig.getTitle());
trade.setBody(payConfig.getDesc());
String payUrl = alipayConfigService.toPayAsApp(alipay, trade);
Map<String, String> payment = new HashMap<>();
payment.put("payInfo", payUrl);
return payment;
}
// 网页支付
public Map<String, String> alipayWeb(PayChannelDto payChannelDto,
String orderId,
String price) throws Exception {
AlipayConfig alipay = parseAliPayConfig(payChannelDto);
alipay.setNotifyUrl(payChannelDto.getNotifyUrl());
TradeVo trade = new TradeVo();
trade.setTotalAmount(price);
trade.setOutTradeNo(orderId);
String payUrl = alipayConfigService.toPayAsWeb(alipay, trade);
Map<String, String> payment = new HashMap<>();
payment.put("payInfo", payUrl);
return payment;
}
// 回调处理
public String notify(HttpServletRequest request) throws IOException, AlipayApiException {
Map<String,String> params = new HashMap<>();
Map requestParams = request.getParameterMap();
// 获取回调参数
for (Iterator iter = requestParams.keySet().iterator(); iter.hasNext();) {
String name = (String)iter.next();
String[] values = (String[])requestParams.get(name);
params.put(name, values[0]);
}
// 验签
String signCheck = AlipaySignature.rsaCheckV1(
params,
alipay.getAlipayPublicKey(),
alipay.getCharset(),
alipay.getSignType());
if(signCheck) {
// 处理业务逻辑
String orderId = params.get("out_trade_no");
MwUserRecharge recharge = userRechargeService.getRecharge(orderId);
finishRecharge(orderId, recharge);
return "success";
}
return "fail";
}
}依赖:
<dependency>
<groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId>
<version>4.x.x</version>
</dependency>集成说明: 集成微信支付、企业付款到零钱等功能。
功能 | 说明 |
|---|---|
APP 支付 | 微信支付客户端支付 |
企业付款 | 提现到微信零钱 |
回调通知 | 支付结果异步通知 |
服务类: WechatPayService.java
@Component
@Slf4j
public class WechatPayService extends PayService {
// APP 支付
public Map<String, Object> pay(PayChannelDto channel,
String orderId,
String price) throws Exception {
WxPayAppOrderResult result = (WxPayAppOrderResult)unifyPay(channel, orderId, price);
Map<String,Object> jsConfig = new HashMap<>();
jsConfig.put("partnerid", result.getPartnerId());
jsConfig.put("appid", result.getAppId());
jsConfig.put("prepayid", result.getPrepayId());
jsConfig.put("package", result.getPackageValue());
jsConfig.put("noncestr", result.getNonceStr());
jsConfig.put("timestamp", result.getTimeStamp());
jsConfig.put("sign", result.getSign());
return jsConfig;
}
// 统一支付
protected Object unifyPay(PayChannelDto channel, String orderId, String price) {
WxPayService wxPayService = getWxPayService(channel);
WxPayUnifiedOrderRequest orderRequest = new WxPayUnifiedOrderRequest();
orderRequest.setOutTradeNo(orderId);
Double d = NumberUtil.mul(Double.parseDouble(price), 100);
orderRequest.setTotalFee(d.intValue());
orderRequest.setSpbillCreateIp(IpUtil.getLocalIP());
orderRequest.setNotifyUrl(channel.getNotifyUrl());
orderRequest.setBody(payConfig.getTitle());
orderRequest.setTradeType("APP");
return wxPayService.createOrder(orderRequest);
}
// 获取微信支付服务
protected WxPayService getPayService(WechatPayConfig config) {
WxPayConfig payConfig = new WxPayConfig();
payConfig.setAppId(config.getAppId());
payConfig.setMchId(config.getMchId());
payConfig.setMchKey(config.getMchKey());
payConfig.setKeyPath(config.getKeyPath());
WxPayService wxPayService = new WxPayServiceImpl();
wxPayService.setConfig(payConfig);
return wxPayService;
}
}依赖:
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-pay</artifactId>
<version>4.x.x</version>
</dependency>集成说明: 集成易宝支付,支持快捷支付、银行卡支付、企业付款等。
功能 | 说明 |
|---|---|
快捷支付 | 银行卡快捷支付 |
绑卡 | 银行卡绑定 |
企业付款 | 提现到银行卡 |
卡 BIN 查询 | 识别银行卡信息 |
服务类: YeePayService.java
// 快捷支付
public Map<String, Object> bankPay(PayChannelDto certProfile,
String orderId,
String price,
String phone,
MwUserCardQueryVo card) {
YeePayConfig yeeConfig = JSON.parseObject(
certProfile.getCertProfile(),
YeePayConfig.class);
UnifiedOrderRequest request = new UnifiedOrderRequest();
request.setParentMerchantNo(yeeConfig.getParentMerchantNo());
request.setMerchantNo(yeeConfig.getMerchantNo());
request.setOrderId(orderId);
request.setOrderAmount(new BigDecimal(price));
request.setGoodsName(payConfig.getTitle());
request.setNotifyUrl(certProfile.getNotifyUrl());
try {
UnifiedOrderResponse response = api.unifiedOrder(request);
Map<String, Object> res = new HashMap<>();
res.put("code", "00000".equals(response.getResult().getCode()) ? "1" : "0");
res.put("url", response.getResult().getCashierUrl());
return res;
} catch (YopClientException e) {
log.error("易宝支付异常", e);
}
return null;
}
// 企业付款(提现)
public PayOrderResponse extract(PayChannelDto certProfile,
String extractId,
BigDecimal extractPrice) {
YeePayConfig yeeConfig = JSON.parseObject(
certProfile.getCertProfile(),
YeePayConfig.class);
PayOrderRequest request = new PayOrderRequest();
request.setParentMerchantNo(yeeConfig.getParentMerchantNo());
request.setMerchantNo(yeeConfig.getMerchantNo());
request.setRequestNo("sfb_" + extractId);
request.setOrderAmount(extractPrice);
request.setReceiveType("REAL_TIME");
request.setNotifyUrl(certProfile.getNotifyUrl());
try {
return extractApi.payOrder(request);
} catch (YopClientException e) {
log.error("易宝提现异常", e);
}
return null;
}依赖:
<dependency>
<groupId>com.yeepay.yop.sdk</groupId>
<artifactId>yop-java-sdk</artifactId>
<version>4.4.0</version>
</dependency>集成说明: 集成 AdaPay 支付渠道,支持多种支付方式。
服务类: AdaPayService.java (394 行代码)
集成说明: 集成通联支付(Allinpay),支持支付、提现等功能。
服务类: SybService.java
集成说明: 集成七牛云对象存储,用于图片、文件等资源的存储。
功能 | 说明 |
|---|---|
文件上传 | 上传图片、视频等文件 |
文件下载 | 获取文件访问 URL |
空间管理 | 管理存储空间 |
工具类: QiNiuUtil.java
public class QiNiuUtil {
// 获取机房对应关系
public static Region getRegion(String zone){
if("华东".equals(zone)){
return Region.huadong();
} else if("华北".equals(zone)){
return Region.huabei();
} else if("华南".equals(zone)){
return Region.huanan();
} else if ("北美".equals(zone)){
return Region.beimei();
} else {
return Region.qvmHuadong();
}
}
// 生成文件名
public static String getKey(String file){
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date();
return FileUtil.getFileNameNoEx(file) + "-" +
sdf.format(date) +
"." +
FileUtil.getExtensionName(file);
}
}服务类: QiNiuService.java
@Service
public class QiNiuServiceImpl implements QiNiuService {
// 文件上传
@Override
public String upload(MultipartFile file, String key) throws IOException {
Configuration cfg = new Configuration(getRegion(zone));
UploadManager uploadManager = new UploadManager(cfg);
Auth auth = Auth.create(accessKey, secretKey);
String upToken = auth.uploadToken(bucket);
Response response = uploadManager.put(file.getBytes(), key, upToken);
// 解析上传结果
return domain + "/" + key;
}
}依赖:
<dependency>
<groupId>com.qiniu</groupId>
<artifactId>qiniu-java-sdk</artifactId>
<version>7.x.x</version>
</dependency>配置:
qiniu:
accessKey: xxxxxx
secretKey: xxxxxx
bucket: xxxxxx
domain: https://xxxxx.cn
zone: 华东集成说明: 集成阿里云对象存储服务。
aliyun:
oss:
file:
endpoint: oss-cn-shanghai.aliyuncs.com
keyid: xxxxxxGXis7oxxxxxxr2D9uF
keysecret: xxxxxxfDuuuxxxxxxzA4D1rGywARr8
bucketname: xxxxxx
domain: "https://oss.xxx.cn/"
avatar: "sfb/avatar/"
card: "sfb/card/"集成说明: 集成阿里云短信服务,用于发送验证码、通知等。
工具类: SmsUtils.java
@Component
@Configuration
@Slf4j
public class SmsUtils {
// 初始化客户端
public static Client createClient(String accessKeyId, String accessKeySecret) throws Exception {
Config config = new Config()
.setAccessKeyId(accessKeyId)
.setAccessKeySecret(accessKeySecret);
config.endpoint = "dysmsapi.aliyuncs.com";
return new Client(config);
}
// 发送短信
public void sendSmsNow(String phoneNumbers, String templateParam) throws Exception {
Client client = SmsUtils.createClient(
SMS_ACCESS_KEY,
SMS_ACCESS_SECRET);
SendSmsRequest sendSmsRequest = new SendSmsRequest()
.setPhoneNumbers(phoneNumbers)
.setSignName(SMS_SIGN)
.setTemplateCode(SMS_TEMPLATE_ID)
.setTemplateParam(templateParam);
try {
SendSmsResponse response = client.sendSmsWithOptions(sendSmsRequest, new RuntimeOptions());
log.info("短信发送结果:{}", JSON.toJSONString(response.getBody()));
} catch (TeaException error) {
log.error("短信发送失败:{}", error.getMessage());
}
}
}依赖:
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>dysmsapi20170525</artifactId>
<version>2.0.16</version>
</dependency>配置:
aliyun:
sms:
accessKey: "xxxxxxZHJxxxxxxc"
accessSecret: "xxxxxxtQfBh7HtrF5KxxxxxxM0BjSp"
sign: "苏分宝"
templateId: "SMS_167961837"集成说明: 集成阿里云 OCR 识别服务,用于身份证、银行卡等识别。
aliyun:
ocr:
path: /usr/ocr/
encryptKey: xxxxxxj4JO8lTQKc3eiQlA==集成说明: 集成极光推送服务,实现消息推送功能。
依赖:
<dependency>
<groupId>cn.jiguang.sdk</groupId>
<artifactId>jpush-client</artifactId>
<version>3.x.x</version>
</dependency>配置:
jpush:
appKey: xxxxxx
masterSecret: xxxxxx# application-dev.yml
# 大淘客配置(淘宝联盟)
dataoke:
key: xxxxxxeb094a5
secret: xxxxxxcee4a4b9579561ec0722cbd734
cmsUrl: https://cmscg.dataoke.com/cms-v2
apiUrl: https://openapi.dataoke.com/api
# 好单库配置(拼多多、外卖等)
haodanku:
key: xxxxxxE08805
waimaiKey: xxxxxxE08805
vip:
appId: xxxxxx66
appSecret: xxxxxxa8531d98c0041cb41435866da7
# 阿里云配置
aliyun:
oss:
file:
endpoint: oss-cn-shanghai.aliyuncs.com
keyid: xxxxxxGXis7oxxxxxxr2D9uF
keysecret: xxxxxxfDuuuxxxxxxzA4D1rGywARr8
bucketname: xxxxxx
domain: "https://oss.xxx.cn/"
sms:
accessKey: "xxxxxxZHJxxxxxxc"
accessSecret: "xxxxxxtQfBh7HtrF5KxxxxxxM0BjSp"
sign: "苏分宝"
templateId: "SMS_167961837"
ocr:
path: /usr/ocr/
encryptKey: xxxxxxj4JO8lTQKc3eiQlA==
# 拼多多配置
pdd:
clientId: xxxxxxe0e3b94b52828xxxxxxe9c0f
clientSecret: xxxxxxa8e131687f1aac5af282xxxxxx99c92639
pid: 1784892_252288888
# 淘宝联盟配置
tb:
appKey: xxxx3230
appSecret: xxxxxxe76575eddfeebxxxxxx8f0f2d2
url: https://eco.taobao.com/router/rest
inviterCode: XSJL93
pid:
channelPid: mm_52650383_39582271_114587650437// 1. 构建搜索参数
GoodsSearchParam param = new GoodsSearchParam();
param.setKeyWords("手机");
param.setPage(1);
param.setPageSize(20);
// 2. 调用搜索接口
JSONObject result = dataokeService.goodsSearch(param);
// 3. 解析结果
JSONArray goodsList = result.getJSONArray("data");
for(int i = 0; i < goodsList.size(); i++) {
JSONObject goods = goodsList.getJSONObject(i);
String title = goods.getString("title");
Double price = goods.getDouble("actualPrice");
String image = goods.getString("image");
// ... 处理商品数据
}// 1. 调用转链接口
JSONObject result = dataokeService.goodsWord(goodsId, pid, channelId);
// 2. 获取淘口令
String tkl = result.getJSONObject("data").getString("text");
// 3. 获取推广链接
String url = result.getJSONObject("data").getString("clickUrl");// 1. 创建订单
MwUserRecharge recharge = new MwUserRecharge();
recharge.setOrderId(orderId);
recharge.setPrice(price);
recharge.setUserId(uid);
recharge.setChannelId(channelId);
// 2. 调用支付接口
Map<String, String> payInfo;
if(payType == PayTypeEnum.ALIPAY) {
payInfo = aliPayService.alipay(payChannel, orderId, price);
} else if(payType == PayTypeEnum.WECHAT) {
payInfo = wechatPayService.pay(payChannel, orderId, price);
}
// 3. 返回前端支付参数
return payInfo;平台 | API 提供方 | 支持功能 | 状态 |
|---|---|---|---|
淘宝 | 大淘客 | 搜索/详情/转链/订单 | ✅ 已集成 |
京东 | 大淘客 | 搜索/详情/转链/订单 | ✅ 已集成 |
拼多多 | 大淘客 | 搜索/详情/转链/订单 | ✅ 已集成 |
抖音 | 大淘客 | 搜索/详情/转链/订单 | ✅ 已集成 |
唯品会 | 大淘客 | 搜索/详情/转链/订单 | ✅ 已集成 |
美团 | 美团联盟 | 商品/订单 | ✅ 已集成 |
饿了么 | 好单库 | 商品/订单 | ✅ 已集成 |
平台 | 功能 | 状态 |
|---|---|---|
支付宝 | APP 支付/网页支付/转账 | ✅ 已集成 |
微信支付 | APP 支付/企业付款 | ✅ 已集成 |
易宝支付 | 快捷支付/绑卡/提现 | ✅ 已集成 |
AdaPay | 多种支付方式 | ✅ 已集成 |
通联支付 | 支付/提现 | ✅ 已集成 |
服务 | 功能 | 状态 |
|---|---|---|
七牛云 | 文件存储 | ✅ 已集成 |
阿里云 OSS | 文件存储 | ✅ 已集成 |
阿里云短信 | 短信发送 | ✅ 已集成 |
阿里云 OCR | 证件识别 | ✅ 已集成 |
极光推送 | 消息推送 | ✅ 已集成 |
文档版本: v1.0 最后更新: 2024-03-20 维护团队: 苏分宝技术团队
Made with ❤️ by 苏分宝团队