Ver código fonte

内容池交互 fix

wangyunpeng 1 semana atrás
pai
commit
f386dc2aab

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/VideoContentListParam.java

@@ -25,7 +25,7 @@ public class VideoContentListParam extends PageParam {
     private Integer sort = 0;
 
     @ApiModelProperty(value = "标签 ")
-    private List<String> tags;
+    private List<Integer> tags;
 
     @ApiModelProperty(value = "近期未使用 0-历史 1-近30天 2-近14天 3-近7天 4-近3天")
     private Integer recentNotUsed;

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/VideoContentItemVO.java

@@ -33,5 +33,5 @@ public class VideoContentItemVO {
     private Double recommendScore;
 
     @ApiModelProperty(value = "标签")
-    private List<String> tags;
+    private List<Integer> tags;
 }

+ 10 - 10
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java

@@ -503,35 +503,35 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         return result;
     }
 
-    private String getVideoContentListTagFilterSql(List<String> tags, Long accountId, String type, String channel) {
+    private String getVideoContentListTagFilterSql(List<Integer> tags, Long accountId, String type, String channel) {
         if (CollectionUtils.isEmpty(tags)) {
             return null;
         }
         StringBuilder sql = new StringBuilder("(");
-        for (String tag : tags) {
+        for (Integer tag : tags) {
             String item;
             switch (tag) {
-                case "票圈受欢迎":
+                case 1:
                     item = "videoTag.platform = 'platform'";
                     break;
-                case "同类用户喜欢":
+                case 2:
                     item = "videoTag.type = '" + type + "'";
                     break;
-                case "你的用户爱看":
+                case 3:
                     item = "videoTag.channel = '" + channel + "'";
                     break;
-                case "猜TA想看":
+                case 4:
                     item = "videoTag.account_id = " + accountId;
                     break;
                 default:
                     item = null;
             }
             if (Objects.nonNull(item)) {
-                sql.append(item).append(" or ");
+                sql.append(item).append(" and ");
             }
         }
         if (sql.length() > 1) {
-            sql.setLength(sql.length() - 4);
+            sql.setLength(sql.length() - 5);
         }
         sql.append(")");
         return sql.toString();
@@ -649,10 +649,10 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             }
             List<ContentPlatformVideoTag> videoTags = videoTagMap.get(video.getVideoId());
             if (CollectionUtils.isNotEmpty(videoTags)) {
-                List<String> tags = new ArrayList<>();
+                List<Integer> tags = new ArrayList<>();
                 for (ContentPlatformVideoTag videoTag : videoTags) {
                     VideoTagEnum tagEnum = VideoTagEnum.from(videoTag.getTag());
-                    tags.add(tagEnum.getTag());
+                    tags.add(tagEnum.getVal());
                 }
                 item.setTags(tags);
             }