songshuai 5 years ago
parent
commit
b8a1584e52

+ 4 - 2
src/main/java/cn/efunbox/audio/entity/res/ResWare.java

@@ -29,7 +29,10 @@ public class ResWare {
     private String chapterDuration;
 
     @Column(name = "down_load_flag")
-    private String downLoadFlag;
+    private String dbDownLoadFlag;
+
+    @Transient
+    private boolean downLoadFlag;
 
     @Column(name = "chapter_pic_url")
     private String chapterPicUrl;
@@ -66,5 +69,4 @@ public class ResWare {
 
     @Column(name = "gmt_modified")
     private Date gmtModified;
-
 }

+ 1 - 1
src/main/java/cn/efunbox/audio/impl/res/ChapterUpdateListServiceImpl.java

@@ -102,7 +102,7 @@ public class ChapterUpdateListServiceImpl implements ChapterUpdateListService {
         String format1 = format.format(gmtModified);
         chapterVO.setUpdatetime(format1);
         chapterVO.setMediaType(resWare.getMediaType());
-        chapterVO.setDownLoadFlag(resWare.getDownLoadFlag());
+        chapterVO.setDownLoadFlag("0".equals(resWare.getDbDownLoadFlag())?true:false);
         ResAlbum resAlbum = resAlbumRepository.find(resWare.getContentId());
         chapterVO.setContentId(resWare.getContentId());
         chapterVO.setContentName(resAlbum.getContentName());

+ 4 - 0
src/main/java/cn/efunbox/audio/impl/res/ResWareServiceImpl.java

@@ -74,6 +74,10 @@ public class ResWareServiceImpl implements ResWareService {
         if(wareList == null || wareList.size() == 0){
             return ResApiResult.error(ResApiCode.NOT_FOUND);
         }
+        wareList.stream().forEach(obj->{
+            obj.setDownLoadFlag("0".equals(obj.getDbDownLoadFlag())?true:false);
+        });
+
         onePage.setChapterList(wareList);
 
 

+ 1 - 1
src/main/java/cn/efunbox/audio/vo/res/ChapterVO.java

@@ -12,7 +12,7 @@ public class ChapterVO {
     private String chapterName;
     private String chapterRanking;
     private String chapterDuration;
-    private String downLoadFlag;
+    private boolean downLoadFlag;
     private String chapterPicUrl;
     private String chapterRecommend;
     private String payMode;