feat: 开发中...
This commit is contained in:
@@ -24,8 +24,8 @@ public class AttachEntity {
|
||||
private Long id;
|
||||
|
||||
@Setter
|
||||
@Column(name = "name", nullable = false)
|
||||
private String name;
|
||||
@Column(name = "filename", nullable = false)
|
||||
private String filename;
|
||||
|
||||
@Setter
|
||||
@Column(name = "content_type", nullable = false)
|
||||
|
@@ -50,7 +50,7 @@ public class AttachService implements IAttachService {
|
||||
}
|
||||
log.info("prepare to save file: {}({} bytes)", file.getOriginalFilename(), file.getSize());
|
||||
AttachEntity attachEntity = new AttachEntity();
|
||||
attachEntity.setName(file.getOriginalFilename());
|
||||
attachEntity.setFilename(file.getOriginalFilename());
|
||||
attachEntity.setContentType(file.getContentType());
|
||||
attachEntity.setData(file.getBytes());
|
||||
attachEntity = attachRepo.save(attachEntity);
|
||||
@@ -91,7 +91,7 @@ public class AttachService implements IAttachService {
|
||||
return ResponseEntity
|
||||
.ok()
|
||||
.header("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||
.header("Content-Disposition", String.format("attachment; filename=\"%s\"", entity.getName()))
|
||||
.header("Content-Disposition", String.format("attachment; filename=\"%s\"", entity.getFilename()))
|
||||
.header("Pragma", "no-cache")
|
||||
.header("Expires", "0")
|
||||
.contentLength(localCacheFile.length())
|
||||
|
@@ -15,6 +15,10 @@ public class AttachInfoResponseVO {
|
||||
@NotNull
|
||||
private Long id;
|
||||
@NotNull
|
||||
private String filename;
|
||||
@NotNull
|
||||
private String contentType;
|
||||
@NotNull
|
||||
private UserInfoResponseVO creator;
|
||||
@NotNull
|
||||
private UserInfoResponseVO updater;
|
||||
|
Reference in New Issue
Block a user