|
@@ -5,11 +5,21 @@ import cn.com.ctop.common.module.entity.MaterialCutFrame;
|
|
|
import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
|
import cn.com.ctop.common.module.service.IMaterialCutFrameService;
|
|
|
import cn.com.ctop.common.module.utils.Check;
|
|
|
-import cn.com.ctop.kuaishou.modules.batch.entity.*;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouImageGet;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouBatchCampaignPreview;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouBatchCreativePreview;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouBatchGroupPreview;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.mapper.KuaishouBatchCampaignPreviewMapper;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.mapper.KuaishouBatchCreativePreviewMapper;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.mapper.KuaishouBatchGroupPreviewMapper;
|
|
|
-import cn.com.ctop.kuaishou.modules.batch.service.*;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouGroupTemplateService;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouImageGetService;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouMaterialUploadService;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouUpdateService;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouVideoGetService;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouBatchCreativePreviewService;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -141,6 +151,12 @@ public class KuaishouBatchCreativePreviewServiceImpl extends ServiceImpl<Kuaisho
|
|
|
JSONObject campaignJson = new JSONObject();
|
|
|
campaignJson.put("campaign_name", campaign.getCampaignName());
|
|
|
campaignJson.put("type", campaign.getCampaignType());
|
|
|
+ if (!Check.isNull(campaign.getAdType())) {
|
|
|
+ campaignJson.put("ad_type", campaign.getAdType());
|
|
|
+ }
|
|
|
+ if (!Check.isNull(campaign.getBidType())) {
|
|
|
+ campaignJson.put("bid_type", campaign.getBidType());
|
|
|
+ }
|
|
|
if (!Check.isNull(campaign.getDayBudget())) {
|
|
|
campaignJson.put("day_budget", campaign.getDayBudget());
|
|
|
}
|
|
@@ -375,11 +391,20 @@ public class KuaishouBatchCreativePreviewServiceImpl extends ServiceImpl<Kuaisho
|
|
|
createJson.put("creative_name", creativePreview.getCreativeName()); // 创意名称
|
|
|
if (!Check.isNull(creativePreview.getPhotoId())) {
|
|
|
createJson.put("photo_id", creativePreview.getPhotoId()); // 视频ID
|
|
|
+ KuaiShouVideoGet video = videoGetService.getVideoByPhotoId(Long.valueOf(creativePreview.getPhotoId()));
|
|
|
+ if (!Check.isNull(video)) {
|
|
|
+ createJson.put("creative_material_type", video.getMaterialType()); // 素材类型
|
|
|
+ }
|
|
|
}
|
|
|
- KuaiShouVideoGet video = videoGetService.getVideoByPhotoId(Long.valueOf(creativePreview.getPhotoId()));
|
|
|
- if (!Check.isNull(video)) {
|
|
|
- createJson.put("creative_material_type", video.getMaterialType()); // 素材类型
|
|
|
+ if (!Check.isNull(creativePreview.getImageTokens())) {
|
|
|
+
|
|
|
+ createJson.put("photo_id", creativePreview.getPhotoId()); // 视频ID
|
|
|
+ KuaiShouVideoGet video = videoGetService.getVideoByPhotoId(Long.valueOf(creativePreview.getPhotoId()));
|
|
|
+ if (!Check.isNull(video)) {
|
|
|
+ createJson.put("creative_material_type", video.getMaterialType()); // 素材类型
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
if (!Check.isNull(creativePreview.getActionBarText())) {
|
|
|
createJson.put("action_bar_text", creativePreview.getActionBarText()); // 行动号召按钮文案
|
|
|
}
|
|
@@ -419,6 +444,13 @@ public class KuaishouBatchCreativePreviewServiceImpl extends ServiceImpl<Kuaisho
|
|
|
if (!Check.isNull(creativePreview.getCreativeTag())) {
|
|
|
createJson.put("creative_tag", JSONObject.parseArray(creativePreview.getCreativeTag())); // 创意标签
|
|
|
}
|
|
|
+ Integer outerLoopNative = creativePreview.getOuterLoopNative();
|
|
|
+ if (!Check.isNull(outerLoopNative)) {
|
|
|
+ createJson.put("outer_loop_native", outerLoopNative);
|
|
|
+ if (outerLoopNative == 1) {
|
|
|
+ createJson.put("kol_user_type", creativePreview.getKolUserType());
|
|
|
+ }
|
|
|
+ }
|
|
|
String image_md5 = creativePreview.getImageSignature();
|
|
|
String imageToken = null;
|
|
|
if (!Check.isNull(image_md5)) {
|