Просмотр исходного кода

feat: return video category in content list

刘立冬 13 часов назад
Родитель
Сommit
8ec7aaf85f

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

@@ -81,6 +81,9 @@ public class VideoContentItemVO {
     @ApiModelProperty(value = "标准元素")
     private String standardElement;
 
+    @ApiModelProperty(value = "品类")
+    private String category = "";
+
     @ApiModelProperty(value = "分类名称")
     private String categoryName;
 

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

@@ -1502,6 +1502,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             if (Objects.isNull(item.getRecommendScore())) {
                 item.setRecommendScore(recommendTypeVideoScoreMap.get(video.getVideoId()));
             }
+            item.setCategory(defaultString(video.getCategory()));
             item.setExperimentId("hot");
             result.add(item);
         }
@@ -2104,6 +2105,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             item.setDemandContentTopic(video.getDemandContentTopic());
             item.setPointType(video.getPointType());
             item.setStandardElement(video.getStandardElement());
+            item.setCategory(defaultString(video.getCategory()));
             item.setCategoryName(video.getCategoryName());
             item.setExperimentId(video.getExperimentId());
             item.setSim(video.getSim());
@@ -2121,6 +2123,10 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         return result;
     }
 
+    private static String defaultString(String value) {
+        return StringUtils.hasText(value) ? value : "";
+    }
+
     @Override
     public Page<XcxPlanItemVO> xcxPlanList(XcxPlanListParam param) {
         ContentPlatformAccount loginAccount = LoginUserContext.getUser();