|
@@ -128,7 +128,7 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
|
|
|
if (!Check.isNull(appTemplate.getPackageName())) {
|
|
|
apkJson.put("package_name", appTemplate.getPackageName());
|
|
|
}
|
|
|
- if (!Check.isNull(appTemplate.getImageUrl()) && ("1".equals(platform) || "3".equals(platform))) {
|
|
|
+ if (!Check.isNull(appTemplate.getImageUrl()) && ("1".equals(platform) || "2".equals(platform))) {
|
|
|
Map<String, Object> imageMap = kuaishouInterfaceService.imageUpload(accountId, accessToken, (String) appTemplate.getImageUrl(), 1);
|
|
|
Integer imageCode = (Integer) imageMap.get("code");
|
|
|
if (imageCode != 0) {
|
|
@@ -136,7 +136,6 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
|
|
|
}
|
|
|
apkJson.put("image_token", imageMap.get("imageToken"));
|
|
|
}
|
|
|
-
|
|
|
Map<String, Object> apkMap;
|
|
|
if ("1".equals(platform) && appTemplate.getUploadType() == 1) {
|
|
|
apkJson.put("file", appTemplate.getFile());
|
|
@@ -192,16 +191,13 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
|
|
|
if (!Check.isNull(groupCreateTemplate.getUnitType())) {
|
|
|
groupJson.put("unit_type", groupCreateTemplate.getUnitType());
|
|
|
}
|
|
|
-
|
|
|
if (!Check.isNull(groupCreateTemplate.getDeepConversionType())) {
|
|
|
groupJson.put("deep_conversion_type", groupCreateTemplate.getDeepConversionType());
|
|
|
}
|
|
|
-
|
|
|
if (!Check.isNull(groupCreateTemplate.getDeepConversionBid()) && groupCreateTemplate.getDeepConversionBid() > 0) {
|
|
|
groupJson.put("deep_conversion_bid", groupCreateTemplate.getDeepConversionBid());
|
|
|
}
|
|
|
|
|
|
-
|
|
|
JSONObject targetJson = new JSONObject();
|
|
|
groupJson.put("target", targetJson);
|
|
|
|
|
@@ -248,7 +244,7 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
|
|
|
|
|
|
@Override
|
|
|
public Map<String, Object> createCreative(JSONObject requestJson) {
|
|
|
- System.err.println("广告类型: " +requestJson.getInteger("positionType"));
|
|
|
+ System.err.println("广告类型: " + requestJson.getInteger("positionType"));
|
|
|
System.err.println("素材类型:" + requestJson.getInteger("creativeMaterialType"));
|
|
|
System.err.println("后贴片图片横竖 :" + requestJson.getString("singlePicTiepianType"));
|
|
|
|
|
@@ -312,6 +308,7 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
|
|
|
localVideoJson.put("videoUrl", requestJson.getString("videoUrl"));
|
|
|
localVideoJson.put("description", requestJson.getString("description"));
|
|
|
localVideoJson.put("positionType", requestJson.getString("positionType"));
|
|
|
+ localVideoJson.put("accountId", requestJson.getString("accountId"));
|
|
|
String videoUrl = videoService.localInsert(localVideoJson); // 校验文件是否在本地有留存记录
|
|
|
if (Check.isNull(videoUrl)) {
|
|
|
logger.error("创建创意视频为空,accountId:{}", accountId);
|
|
@@ -355,6 +352,7 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
|
|
|
imageJson.put("loginId", requestJson.getString("loginId"));
|
|
|
imageJson.put("videoUploadType", requestJson.getString("creativeMaterialType"));
|
|
|
imageJson.put("url", imageUrl);
|
|
|
+ imageJson.put("accountId", accountId);
|
|
|
imageJson.put("positionType", requestJson.getString("positionType"));
|
|
|
String imagePath = imageService.localInsert(imageJson);
|
|
|
|
|
@@ -395,6 +393,7 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
|
|
|
JSONObject haveLocalVideoJson = new JSONObject();
|
|
|
haveLocalVideoJson.put("positionType", requestJson.getString("positionType"));
|
|
|
haveLocalVideoJson.put("videoUrl", haveSinglePicVideoUrl);
|
|
|
+ haveLocalVideoJson.put("accountId", accountId);
|
|
|
haveLocalVideoJson.put("description", requestJson.getString("description"));
|
|
|
haveLocalVideoJson.put("login_id", requestJson.getString("loginId"));
|
|
|
haveLocalVideoJson.put("videoType", requestJson.getString("creativeMaterialType"));
|
|
@@ -441,12 +440,11 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
|
|
|
}
|
|
|
JSONObject imageJson = new JSONObject();
|
|
|
imageJson.put("url", imageUrl);
|
|
|
+ imageJson.put("accountId", accountId);
|
|
|
imageJson.put("positionType", requestJson.getInteger("positionType"));
|
|
|
imageJson.put("loginId", requestJson.getString("loginId"));
|
|
|
imageJson.put("videoUploadType", requestJson.getString("singlePicTiepianType"));
|
|
|
-
|
|
|
String imagePath = imageService.localInsert(imageJson);
|
|
|
-
|
|
|
Map<String, Object> imageMap = kuaishouInterfaceService.imageUpload(accountId, accessToken, imagePath, 0);
|
|
|
if ((Integer) imageMap.get("code") != 0) {
|
|
|
logger.error("上传后贴片单张图片素材失败,accountId:{}", accountId);
|