|
@@ -6,6 +6,7 @@ import cn.com.ctop.job.bytedance.data.entity.DianzhongMovieConfig;
|
|
|
import cn.com.ctop.job.bytedance.data.mapper.DianzhongConfigMapper;
|
|
import cn.com.ctop.job.bytedance.data.mapper.DianzhongConfigMapper;
|
|
|
import cn.com.ctop.job.bytedance.data.service.IDianzhongConfigService;
|
|
import cn.com.ctop.job.bytedance.data.service.IDianzhongConfigService;
|
|
|
import cn.com.ctop.job.bytedance.data.utils.HttpUtils;
|
|
import cn.com.ctop.job.bytedance.data.utils.HttpUtils;
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -86,7 +87,17 @@ public class DianzhongConfigServiceImpl implements IDianzhongConfigService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void pullMovie() throws IOException {
|
|
public void pullMovie() throws IOException {
|
|
|
- pullMoviePage(0, 100);
|
|
|
|
|
|
|
+ pullMoviePage(1100, 100);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void syncPromoteLinkInfo() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ String url = "https://api.deepthink.artlinkworld.cn/dianzhong/syncAll";
|
|
|
|
|
+ String s = HttpUtils.httpPostRequest(url, null, null);
|
|
|
|
|
+ }catch (Exception ignored){
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void pullMoviePage(int offset, int limit) throws IOException {
|
|
private void pullMoviePage(int offset, int limit) throws IOException {
|
|
@@ -102,7 +113,7 @@ public class DianzhongConfigServiceImpl implements IDianzhongConfigService {
|
|
|
String res = HttpUtils.httpGet(url, null, headers);
|
|
String res = HttpUtils.httpGet(url, null, headers);
|
|
|
if (StringUtils.isNotEmpty(res)){
|
|
if (StringUtils.isNotEmpty(res)){
|
|
|
pullMovieInfo(res);
|
|
pullMovieInfo(res);
|
|
|
- if (offset <=100){ //每次只拉最近300个
|
|
|
|
|
|
|
+ if (offset < 2000){ //每次只拉最近300个
|
|
|
pullMoviePage(offset+limit, limit);
|
|
pullMoviePage(offset+limit, limit);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -111,7 +122,7 @@ public class DianzhongConfigServiceImpl implements IDianzhongConfigService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void pullMovieInfo(String str) throws IOException {
|
|
public void pullMovieInfo(String str) throws IOException {
|
|
|
- JSONObject res = JSONArray.parseObject(str);
|
|
|
|
|
|
|
+ JSONObject res = JSON.parseObject(str);
|
|
|
JSONArray rows = res.getJSONArray("rows");
|
|
JSONArray rows = res.getJSONArray("rows");
|
|
|
if (rows==null || rows.isEmpty()){
|
|
if (rows==null || rows.isEmpty()){
|
|
|
return;
|
|
return;
|