|
@@ -100,7 +100,7 @@ public class KuaishouProgramCreativeServiceImpl extends ServiceImpl<KuaishouProg
|
|
|
}
|
|
|
|
|
|
this.saveOrUpdateBatch(programCreativeList);
|
|
|
- // getProgramCreative(accountId, unitId, accessToken, startDate, endDate, page + 1);
|
|
|
+ // getProgramCreative(accountId, unitId, accessToken, startDate, endDate, page + 1);
|
|
|
|
|
|
|
|
|
}
|
|
@@ -115,6 +115,8 @@ public class KuaishouProgramCreativeServiceImpl extends ServiceImpl<KuaishouProg
|
|
|
|
|
|
@Override
|
|
|
public JSONObject createProgramCreative(CtopOauthToken oauthToken, JSONObject requestJson) {
|
|
|
+
|
|
|
+ JSONObject returnJson = new JSONObject();
|
|
|
try {
|
|
|
|
|
|
|
|
@@ -176,13 +178,6 @@ public class KuaishouProgramCreativeServiceImpl extends ServiceImpl<KuaishouProg
|
|
|
imageToken = uploadService.kuauiShouImageUpload(imageUrl, signature, oauthToken.getAccountId(), oauthToken.getAccessToken());
|
|
|
}
|
|
|
cover_image_tokens.add(imageToken);
|
|
|
- /*if (Check.isNull(imageToken)) {
|
|
|
- JSONObject failJson = new JSONObject();
|
|
|
- failJson.put("creativeName", name);
|
|
|
- failJson.put("failMessage", "获取图片文件失败");
|
|
|
- failArr.add(failJson);
|
|
|
- continue;
|
|
|
- }*/
|
|
|
}
|
|
|
|
|
|
|
|
@@ -194,14 +189,29 @@ public class KuaishouProgramCreativeServiceImpl extends ServiceImpl<KuaishouProg
|
|
|
pramsJson.put("cover_image_tokens", cover_image_tokens);
|
|
|
|
|
|
String result = HttpUtils.kuaiShouhttpPostRequest(url, pramsJson.toJSONString(), headers);
|
|
|
- System.err.println(result);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
+ log.info("创建程序化创意返回结果:{}", jsonObject);
|
|
|
+ if (!Check.isNull(jsonObject)) {
|
|
|
+ Integer code = jsonObject.getInteger("code");
|
|
|
+ if (code == 0) {
|
|
|
+ returnJson.put("isTrueOrFalse", true);
|
|
|
+ returnJson.put("message", "创建成功");
|
|
|
+ } else {
|
|
|
+ returnJson.put("isTrueOrFalse", false);
|
|
|
+ returnJson.put("message", jsonObject.getString("message"));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ returnJson.put("isTrueOrFalse", false);
|
|
|
+ returnJson.put("message", "系统错误");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
- return null;
|
|
|
+ return returnJson;
|
|
|
}
|
|
|
}
|