|
|
@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.hfkj.common.exception.ErrorCode; |
|
|
|
import com.hfkj.common.exception.ErrorCode; |
|
|
|
import com.hfkj.common.exception.ErrorHelp; |
|
|
|
import com.hfkj.common.exception.ErrorHelp; |
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
|
|
|
|
import com.hfkj.entity.BsUser; |
|
|
|
|
|
|
|
import com.hfkj.service.user.BsUserService; |
|
|
|
import com.taobao.top.DefaultTopApiClient; |
|
|
|
import com.taobao.top.DefaultTopApiClient; |
|
|
|
import com.taobao.top.TopApiClient; |
|
|
|
import com.taobao.top.TopApiClient; |
|
|
|
import com.taobao.top.ability304.Ability304; |
|
|
|
import com.taobao.top.ability304.Ability304; |
|
|
@ -14,18 +16,26 @@ import com.taobao.top.ability375.Ability375; |
|
|
|
import com.taobao.top.ability375.request.TaobaoTbkTpwdCreateRequest; |
|
|
|
import com.taobao.top.ability375.request.TaobaoTbkTpwdCreateRequest; |
|
|
|
import com.taobao.top.ability375.response.TaobaoTbkTpwdCreateResponse; |
|
|
|
import com.taobao.top.ability375.response.TaobaoTbkTpwdCreateResponse; |
|
|
|
import com.taobao.top.ability425.Ability425; |
|
|
|
import com.taobao.top.ability425.Ability425; |
|
|
|
|
|
|
|
import com.taobao.top.ability425.request.TaobaoTbkScInvitecodeGetRequest; |
|
|
|
|
|
|
|
import com.taobao.top.ability425.request.TaobaoTbkScPublisherInfoGetRequest; |
|
|
|
import com.taobao.top.ability425.request.TaobaoTbkScPublisherInfoSaveRequest; |
|
|
|
import com.taobao.top.ability425.request.TaobaoTbkScPublisherInfoSaveRequest; |
|
|
|
|
|
|
|
import com.taobao.top.ability425.response.TaobaoTbkScInvitecodeGetResponse; |
|
|
|
|
|
|
|
import com.taobao.top.ability425.response.TaobaoTbkScPublisherInfoGetResponse; |
|
|
|
import com.taobao.top.ability425.response.TaobaoTbkScPublisherInfoSaveResponse; |
|
|
|
import com.taobao.top.ability425.response.TaobaoTbkScPublisherInfoSaveResponse; |
|
|
|
import com.taobao.top.defaultability.Defaultability; |
|
|
|
import com.taobao.top.defaultability.Defaultability; |
|
|
|
import com.taobao.top.defaultability.domain.TaobaoTbkOptimusTouMaterialIdsGetMaterialQuery; |
|
|
|
import com.taobao.top.defaultability.domain.*; |
|
|
|
|
|
|
|
import com.taobao.top.defaultability.request.TaobaoTbkDgGeneralLinkConvertRequest; |
|
|
|
import com.taobao.top.defaultability.request.TaobaoTbkDgMaterialOptionalUpgradeRequest; |
|
|
|
import com.taobao.top.defaultability.request.TaobaoTbkDgMaterialOptionalUpgradeRequest; |
|
|
|
|
|
|
|
import com.taobao.top.defaultability.response.TaobaoTbkDgGeneralLinkConvertResponse; |
|
|
|
import com.taobao.top.defaultability.response.TaobaoTbkDgMaterialOptionalUpgradeResponse; |
|
|
|
import com.taobao.top.defaultability.response.TaobaoTbkDgMaterialOptionalUpgradeResponse; |
|
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class TaoBaoService { |
|
|
|
public class TaoBaoService { |
|
|
@ -37,6 +47,9 @@ public class TaoBaoService { |
|
|
|
private static String appsecret = "f04baedca9cd794665dfa04a2fcbfd86"; |
|
|
|
private static String appsecret = "f04baedca9cd794665dfa04a2fcbfd86"; |
|
|
|
private static String url = "https://eco.taobao.com/router/rest"; |
|
|
|
private static String url = "https://eco.taobao.com/router/rest"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private BsUserService userService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @MethodName material |
|
|
|
* @MethodName material |
|
|
|
* @Description:淘宝客-推广者-物料id列表查询 |
|
|
|
* @Description:淘宝客-推广者-物料id列表查询 |
|
|
@ -47,10 +60,11 @@ public class TaoBaoService { |
|
|
|
* @Author: Sum1Dream |
|
|
|
* @Author: Sum1Dream |
|
|
|
* @Date: 2024/9/10 下午1:52 |
|
|
|
* @Date: 2024/9/10 下午1:52 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static JSONObject material(String title , Long pageNo , Long pageSize) throws Exception { |
|
|
|
public static JSONObject material(String title , Long pageNo , Long pageSize , String specialId) throws Exception { |
|
|
|
if (StringUtils.isBlank(title)) { |
|
|
|
if (StringUtils.isBlank(title)) { |
|
|
|
title = "百货"; |
|
|
|
title = "百货"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
log.info("============ 淘宝客-推广者-物料id列表查询-START ============="); |
|
|
|
log.info("============ 淘宝客-推广者-物料id列表查询-START ============="); |
|
|
|
TopApiClient client = new DefaultTopApiClient(appKey,appsecret,url); |
|
|
|
TopApiClient client = new DefaultTopApiClient(appKey,appsecret,url); |
|
|
|
Defaultability apiPackage = new Defaultability(client); |
|
|
|
Defaultability apiPackage = new Defaultability(client); |
|
|
@ -62,6 +76,7 @@ public class TaoBaoService { |
|
|
|
TaobaoTbkDgMaterialOptionalUpgradeRequest request = new TaobaoTbkDgMaterialOptionalUpgradeRequest(); |
|
|
|
TaobaoTbkDgMaterialOptionalUpgradeRequest request = new TaobaoTbkDgMaterialOptionalUpgradeRequest(); |
|
|
|
request.setQ(title); |
|
|
|
request.setQ(title); |
|
|
|
request.setPageNo(pageNo); |
|
|
|
request.setPageNo(pageNo); |
|
|
|
|
|
|
|
request.setRelationId(specialId); |
|
|
|
request.setHasCoupon(true); |
|
|
|
request.setHasCoupon(true); |
|
|
|
request.setPageSize(pageSize); |
|
|
|
request.setPageSize(pageSize); |
|
|
|
request.setAdzoneId(115764450446L); |
|
|
|
request.setAdzoneId(115764450446L); |
|
|
@ -120,7 +135,7 @@ public class TaoBaoService { |
|
|
|
* @Author: Sum1Dream |
|
|
|
* @Author: Sum1Dream |
|
|
|
* @Date: 2024/9/23 上午11:40 |
|
|
|
* @Date: 2024/9/23 上午11:40 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static JSONObject publisher(String token) throws Exception { |
|
|
|
public static JSONObject publisher(String token , String code) throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
log.info("============ 淘宝客-公用-私域用户备案-START ============="); |
|
|
|
log.info("============ 淘宝客-公用-私域用户备案-START ============="); |
|
|
|
TopApiClient client = new DefaultTopApiClient(appKey,appsecret,url); |
|
|
|
TopApiClient client = new DefaultTopApiClient(appKey,appsecret,url); |
|
|
@ -129,7 +144,7 @@ public class TaoBaoService { |
|
|
|
|
|
|
|
|
|
|
|
// create request
|
|
|
|
// create request
|
|
|
|
TaobaoTbkScPublisherInfoSaveRequest request = new TaobaoTbkScPublisherInfoSaveRequest(); |
|
|
|
TaobaoTbkScPublisherInfoSaveRequest request = new TaobaoTbkScPublisherInfoSaveRequest(); |
|
|
|
request.setInviterCode("JIIIVF"); |
|
|
|
request.setInviterCode(code); |
|
|
|
request.setInfoType(1L); |
|
|
|
request.setInfoType(1L); |
|
|
|
request.setNote("元气"); |
|
|
|
request.setNote("元气"); |
|
|
|
|
|
|
|
|
|
|
@ -145,6 +160,7 @@ public class TaoBaoService { |
|
|
|
return JSONObject.parseObject(JSON.toJSONString(response)); |
|
|
|
return JSONObject.parseObject(JSON.toJSONString(response)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @MethodName getToken |
|
|
|
* @MethodName getToken |
|
|
|
* @Description:获取Access Token |
|
|
|
* @Description:获取Access Token |
|
|
@ -177,5 +193,4 @@ public class TaoBaoService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|