Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

syh 4 gadi atpakaļ
vecāks
revīzija
c585389afd

+ 4 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaishouProgramCreative.java

@@ -135,6 +135,10 @@ public class KuaishouProgramCreative {
     @Excel(name = "程序化创意状态描述", width = 15)
     @ApiModelProperty(value = "程序化创意状态描述")
     private String viewStatusReason;
+
+    private Integer creativeCategory;
+    private String creativeTag;
+
     /**
      * 创意创建时间
      */

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -2706,7 +2706,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
 
             String endDate = DateUtils.getNowDate("yyyy-MM-dd");
-            String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", endDate, -1);
+            String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", endDate, -2);
             json.put("start_date", startDate);
             json.put("end_date", endDate);
             String result = HttpUtils.kuaiShouhttpPostRequest(url, json.toJSONString(), headers);

+ 8 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouProgramCreativeServiceImpl.java

@@ -139,6 +139,13 @@ public class KuaishouProgramCreativeServiceImpl extends ServiceImpl<KuaishouProg
                 pramsJson.put("cover_slogans", requestJson.getJSONArray("coverSlogans"));
             }
 
+            Integer creativeCategory = requestJson.getInteger("creativeCategory");
+            JSONArray creativeTag = requestJson.getJSONArray("creativeTag");
+
+            if (!Check.isNull(creativeCategory) && !Check.isNull(creativeTag)) {
+                pramsJson.put("creative_category", creativeCategory);
+                pramsJson.put("creative_tag", creativeTag);
+            }
             pramsJson.put("action_bar", requestJson.getString("actionBarText"));
             pramsJson.put("captions", requestJson.getJSONArray("captions"));
             if (!Check.isNull(requestJson.getString("clickUrl"))) {
@@ -151,8 +158,6 @@ public class KuaishouProgramCreativeServiceImpl extends ServiceImpl<KuaishouProg
             headers.put("Content-Type", "application/json");
             headers.put("Access-Token", oauthToken.getAccessToken());
             String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.PROGRAM_CREATE;
-
-
             JSONArray coverImageTokens = requestJson.getJSONArray("coverImageTokens");
             JSONArray cover_image_tokens = new JSONArray();
             requestJson.remove(coverImageTokens);
@@ -197,7 +202,7 @@ public class KuaishouProgramCreativeServiceImpl extends ServiceImpl<KuaishouProg
                     returnJson.put("isTrueOrFalse", true);
                     returnJson.put("message", "创建成功");
                 } else {
-                    log.error("创建失败:入参:{}",pramsJson);
+                    log.error("创建失败:入参:{}", pramsJson);
                     returnJson.put("isTrueOrFalse", false);
                     returnJson.put("message", jsonObject.getString("message"));
                 }