feat: 增加fileSize

dev
huangfeng 10 months ago
parent 3f64545474
commit 12594e67cd

@ -19,6 +19,8 @@ public class TerminalUpload implements Serializable {
private String title;
private Long fileSize;
private static final long serialVersionUID = 1L;
}

@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.List;
@ -84,6 +85,10 @@ public class UploadServiceImpl implements UploadService {
if (CollectionUtil.isNotEmpty(list)) {
for (TerminalUpload item : list) {
item.setPath(path + item.getPath());
File file = new File(item.getPath());
if (file.exists()) {
item.setFileSize(file.length());
}
}
}
TableDataInfo dataTable = PageUtils.getDataTable(list);

Loading…
Cancel
Save