|
|
@@ -389,16 +389,16 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String getPage(Staff staff, Long videoId, String typeOne, String typeTwo) {
|
|
|
+ public String getPage(String putScene, String channel, Staff staff, Long videoId, String typeOne, String typeTwo) {
|
|
|
try {
|
|
|
if (staff == null || staff.getCarrierId() == null) {
|
|
|
return "";
|
|
|
}
|
|
|
- String page = selectPage(videoId, staff.getCarrierId(), typeOne, typeTwo);
|
|
|
+ String page = selectPage(putScene, channel, videoId, staff.getCarrierId(), typeOne, typeTwo);
|
|
|
if (StringUtils.isNotEmpty(page)) {
|
|
|
return page;
|
|
|
}
|
|
|
- return insertPage("touliu", staff.getCarrierId(), videoId, staff.getRemark(), typeOne, typeTwo);
|
|
|
+ return insertPage(putScene, channel, staff.getCarrierId(), videoId, staff.getRemark(), typeOne, typeTwo);
|
|
|
} catch (IOException e) {
|
|
|
log.error("MessageAttachmentService getPage error", e);
|
|
|
}
|
|
|
@@ -406,21 +406,21 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String getPageNoCache(String putScene, Staff staff, Long videoId, String typeOne, String typeTwo) {
|
|
|
+ public String getPageNoCache(String putScene, String channel, Staff staff, Long videoId, String typeOne, String typeTwo) {
|
|
|
try {
|
|
|
if (staff == null || staff.getCarrierId() == null) {
|
|
|
return "";
|
|
|
}
|
|
|
- return insertPage(putScene, staff.getCarrierId(), videoId, staff.getRemark(), typeOne, typeTwo);
|
|
|
+ return insertPage(putScene, channel, staff.getCarrierId(), videoId, staff.getRemark(), typeOne, typeTwo);
|
|
|
} catch (IOException e) {
|
|
|
log.error("MessageAttachmentService getPageNoCache error", e);
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- private String insertPage(String putScene, String carrierId, Long videoId, String remark, String typeOne, String typeTwo) throws IOException {
|
|
|
+ private String insertPage(String putScene, String channel, String carrierId, Long videoId, String remark, String typeOne, String typeTwo) throws IOException {
|
|
|
AdPutFlowParam param = new AdPutFlowParam();
|
|
|
- param.setChannel("tencentqw");
|
|
|
+ param.setChannel(channel);
|
|
|
param.setPath("pages/category.html");
|
|
|
param.setPutCarrierId(carrierId);
|
|
|
param.setPutScene(putScene);
|
|
|
@@ -442,10 +442,10 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
|
|
|
return data.getString("url");
|
|
|
}
|
|
|
|
|
|
- public String selectPage(Long videoId, String carrierId, String typeOne, String typeTwo) {
|
|
|
+ public String selectPage(String putScene, String channel, Long videoId, String carrierId, String typeOne, String typeTwo) {
|
|
|
int totalPage = 1;
|
|
|
for (int n = 1; n <= totalPage; n++) {
|
|
|
- String url = getUrl(videoId, n);
|
|
|
+ String url = getUrl(videoId, putScene, channel, n);
|
|
|
try {
|
|
|
String res = httpPoolClient.get(url);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(res);
|
|
|
@@ -479,10 +479,8 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- private static String getUrl(Long videoId, int n) {
|
|
|
+ private static String getUrl(Long videoId, String putScene, String channel, int n) {
|
|
|
String baseUrl = "https://api.piaoquantv.com/ad/put/flow/list/tencent";
|
|
|
- String putScene = "touliu";
|
|
|
- String channel = "tencentqw";
|
|
|
int pageSize = 20;
|
|
|
return String.format(
|
|
|
"%s?videoId=%d&putScene=%s&channel=%s¤tPage=%d&pageSize=%d",
|