Showing
4 changed files
with
17 additions
and
0 deletions
| @@ -2,11 +2,13 @@ package com.wondertek.entity; | @@ -2,11 +2,13 @@ package com.wondertek.entity; | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | import com.baomidou.mybatisplus.annotation.IdType; | 4 | import com.baomidou.mybatisplus.annotation.IdType; |
| 5 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
| 5 | import com.baomidou.mybatisplus.annotation.TableId; | 6 | import com.baomidou.mybatisplus.annotation.TableId; |
| 6 | import com.baomidou.mybatisplus.annotation.TableName; | 7 | import com.baomidou.mybatisplus.annotation.TableName; |
| 7 | import com.baomidou.mybatisplus.extension.activerecord.Model; | 8 | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| 8 | import com.fasterxml.jackson.annotation.JsonFormat; | 9 | import com.fasterxml.jackson.annotation.JsonFormat; |
| 9 | import lombok.Data; | 10 | import lombok.Data; |
| 11 | +import org.springframework.transaction.annotation.Transactional; | ||
| 10 | import org.yaml.snakeyaml.events.Event; | 12 | import org.yaml.snakeyaml.events.Event; |
| 11 | 13 | ||
| 12 | import java.io.Serializable; | 14 | import java.io.Serializable; |
| @@ -46,5 +48,10 @@ public class BackupMaterial extends Model<BackupMaterial> { | @@ -46,5 +48,10 @@ public class BackupMaterial extends Model<BackupMaterial> { | ||
| 46 | /** 封面路径 */ | 48 | /** 封面路径 */ |
| 47 | private String coverPath; | 49 | private String coverPath; |
| 48 | 50 | ||
| 51 | + @TableField(exist = false) | ||
| 52 | + private String fileUrl; | ||
| 53 | + @TableField(exist = false) | ||
| 54 | + private String coverUrl; | ||
| 55 | + | ||
| 49 | 56 | ||
| 50 | } | 57 | } |
| @@ -57,6 +57,8 @@ public class BackupMaterialServiceImpl extends ServiceImpl<BackupMaterialMapper, | @@ -57,6 +57,8 @@ public class BackupMaterialServiceImpl extends ServiceImpl<BackupMaterialMapper, | ||
| 57 | private String swapBackupUrl; | 57 | private String swapBackupUrl; |
| 58 | @Value("${rec.getImageUrl}") | 58 | @Value("${rec.getImageUrl}") |
| 59 | private String recGetImageUrl; | 59 | private String recGetImageUrl; |
| 60 | + @Value("${file.previewUrl}") | ||
| 61 | + private String previewUrl; | ||
| 60 | 62 | ||
| 61 | 63 | ||
| 62 | @Override | 64 | @Override |
| @@ -74,10 +76,16 @@ public class BackupMaterialServiceImpl extends ServiceImpl<BackupMaterialMapper, | @@ -74,10 +76,16 @@ public class BackupMaterialServiceImpl extends ServiceImpl<BackupMaterialMapper, | ||
| 74 | if(StringUtils.isNotBlank(backupMaterialDto.getBackupName())){ | 76 | if(StringUtils.isNotBlank(backupMaterialDto.getBackupName())){ |
| 75 | queryWrapper.like(BackupMaterial::getBackupName,backupMaterialDto.getBackupName()); | 77 | queryWrapper.like(BackupMaterial::getBackupName,backupMaterialDto.getBackupName()); |
| 76 | } | 78 | } |
| 79 | + queryWrapper.orderByDesc(BackupMaterial::getCreatedTime); | ||
| 77 | 80 | ||
| 78 | Page<BackupMaterial> pageInfo = new Page<>(page, size); | 81 | Page<BackupMaterial> pageInfo = new Page<>(page, size); |
| 79 | 82 | ||
| 80 | IPage<BackupMaterial> resultPage = backupMaterialMapper.selectPage(pageInfo, queryWrapper); | 83 | IPage<BackupMaterial> resultPage = backupMaterialMapper.selectPage(pageInfo, queryWrapper); |
| 84 | + //添加预览地址 | ||
| 85 | + resultPage.getRecords().forEach(backupMaterial -> { | ||
| 86 | + backupMaterial.setFileUrl(previewUrl+backupMaterial.getFileUrl()); | ||
| 87 | + backupMaterial.setCoverUrl(previewUrl+backupMaterial.getCoverUrl()); | ||
| 88 | + }); | ||
| 81 | return new PageBean(Integer.parseInt(String.valueOf(resultPage.getPages())),resultPage.getTotal(),resultPage.getRecords()); | 89 | return new PageBean(Integer.parseInt(String.valueOf(resultPage.getPages())),resultPage.getTotal(),resultPage.getRecords()); |
| 82 | } | 90 | } |
| 83 | 91 |
| @@ -71,6 +71,7 @@ rec: | @@ -71,6 +71,7 @@ rec: | ||
| 71 | 71 | ||
| 72 | file: | 72 | file: |
| 73 | realPath: /home/wondertek/material_file_assets/dianpian/ | 73 | realPath: /home/wondertek/material_file_assets/dianpian/ |
| 74 | + previewUrl: https://dev.aivideo.cn/mdi/rehuo-wucai-file-service/preview/crp/ #预览前缀 | ||
| 74 | 75 | ||
| 75 | crp: | 76 | crp: |
| 76 | pIp: 180.167.180.242 | 77 | pIp: 180.167.180.242 |
| @@ -71,6 +71,7 @@ rec: | @@ -71,6 +71,7 @@ rec: | ||
| 71 | 71 | ||
| 72 | file: | 72 | file: |
| 73 | realPath: /home/wondertek/material_file_assets/dianpian/ | 73 | realPath: /home/wondertek/material_file_assets/dianpian/ |
| 74 | + previewUrl: https://dev.aivideo.cn/mdi/rehuo-wucai-file-service/preview/crp/ #预览前缀 | ||
| 74 | 75 | ||
| 75 | crp: | 76 | crp: |
| 76 | pIp: 180.167.180.242 | 77 | pIp: 180.167.180.242 |
-
Please register or login to post a comment