|
@@ -9,6 +9,7 @@ import cn.com.ctop.crawler.modules.pangolin.entity.PangolinApp;
|
|
import cn.com.ctop.crawler.modules.pangolin.service.PangolinAppService;
|
|
import cn.com.ctop.crawler.modules.pangolin.service.PangolinAppService;
|
|
import cn.com.ctop.crawler.modules.pangolin.service.PangolinCrawlerService;
|
|
import cn.com.ctop.crawler.modules.pangolin.service.PangolinCrawlerService;
|
|
import cn.com.ctop.crawler.modules.pangolin.service.PangolinLoginService;
|
|
import cn.com.ctop.crawler.modules.pangolin.service.PangolinLoginService;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.impl.KuaishouInterfaceServiceImpl;
|
|
import cn.com.ctop.toutiao.modules.report.service.IBytedanceFundDailyService;
|
|
import cn.com.ctop.toutiao.modules.report.service.IBytedanceFundDailyService;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -36,15 +37,25 @@ public class SampleTest {
|
|
private PangolinCrawlerService pangolinCrawlerService;
|
|
private PangolinCrawlerService pangolinCrawlerService;
|
|
@Autowired
|
|
@Autowired
|
|
private PangolinAppService pangolinAppService;
|
|
private PangolinAppService pangolinAppService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private KuaishouInterfaceServiceImpl interfaceService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Test
|
|
|
|
+ public void suzhao() {
|
|
|
|
+ interfaceService.getSuZaoList("33e4f5b5fa460386e8d2f4d4113c1f27",161468L,1);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
@Test
|
|
@Test
|
|
- public void testPangolinLogin(){
|
|
|
|
|
|
+ public void testPangolinLogin() {
|
|
QueryWrapper<BindAccountLogin> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<BindAccountLogin> queryWrapper = new QueryWrapper<>();
|
|
- queryWrapper.eq("login_type","pangolin");
|
|
|
|
- queryWrapper.eq("status",1);
|
|
|
|
|
|
+ queryWrapper.eq("login_type", "pangolin");
|
|
|
|
+ queryWrapper.eq("status", 1);
|
|
List<BindAccountLogin> list = bindAccountLoginService.list(queryWrapper);
|
|
List<BindAccountLogin> list = bindAccountLoginService.list(queryWrapper);
|
|
- if(list!=null&&!list.isEmpty()){
|
|
|
|
- for (BindAccountLogin login:list) {
|
|
|
|
- if(null==login.getCookie()||"".equals(login.getCookie().trim())){
|
|
|
|
|
|
+ if (list != null && !list.isEmpty()) {
|
|
|
|
+ for (BindAccountLogin login : list) {
|
|
|
|
+ if (null == login.getCookie() || "".equals(login.getCookie().trim())) {
|
|
pangolinLoginService.pangolinLogin(login.getAccountName(), login.getPassword());
|
|
pangolinLoginService.pangolinLogin(login.getAccountName(), login.getPassword());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -52,7 +63,7 @@ public class SampleTest {
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
- public void testPangolinData(){
|
|
|
|
|
|
+ public void testPangolinData() {
|
|
QueryWrapper<BindAccountLogin> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<BindAccountLogin> queryWrapper = new QueryWrapper<>();
|
|
queryWrapper.eq("login_type", "pangolin");
|
|
queryWrapper.eq("login_type", "pangolin");
|
|
queryWrapper.eq("status", 1);
|
|
queryWrapper.eq("status", 1);
|
|
@@ -81,23 +92,23 @@ public class SampleTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|
|
- public void testflowFund(){
|
|
|
|
|
|
+ public void testflowFund() {
|
|
List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
|
|
List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
|
|
if (null == tokens || tokens.size() <= 0) {
|
|
if (null == tokens || tokens.size() <= 0) {
|
|
log.error("头条账户流水数据异常:未获取到可用的token");
|
|
log.error("头条账户流水数据异常:未获取到可用的token");
|
|
- return ;
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
- CountDownLatch countDownLatch = new CountDownLatch(tokens.size());
|
|
|
|
|
|
+ CountDownLatch countDownLatch = new CountDownLatch(tokens.size());
|
|
executorService = Executors.newFixedThreadPool(5);
|
|
executorService = Executors.newFixedThreadPool(5);
|
|
tokens.forEach(token -> {
|
|
tokens.forEach(token -> {
|
|
executorService.submit(() -> {
|
|
executorService.submit(() -> {
|
|
try {
|
|
try {
|
|
- for(int i=0;i<60;i++){
|
|
|
|
- String findDate = DateUtils.addDay(DateUtils.formatDate(),-i);
|
|
|
|
- bytedanceFundDailyService.loadFundDataByPage(token, findDate, findDate,1);
|
|
|
|
|
|
+ for (int i = 0; i < 60; i++) {
|
|
|
|
+ String findDate = DateUtils.addDay(DateUtils.formatDate(), -i);
|
|
|
|
+ bytedanceFundDailyService.loadFundDataByPage(token, findDate, findDate, 1);
|
|
}
|
|
}
|
|
- }catch (Exception e){
|
|
|
|
- }finally {
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ } finally {
|
|
countDownLatch.countDown();
|
|
countDownLatch.countDown();
|
|
}
|
|
}
|
|
});
|
|
});
|