|
@@ -17,6 +17,7 @@ import org.springframework.core.io.Resource;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
@@ -45,6 +46,7 @@ public class InsUploadFilesServiceImpl extends ServiceImpl<InsUploadFilesMapper,
|
|
|
private String uploadFileUrl;
|
|
private String uploadFileUrl;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ @Transactional
|
|
|
public InsUploadFiles uploadFile(MultipartFile multipartFile, String username, String type) throws IOException {
|
|
public InsUploadFiles uploadFile(MultipartFile multipartFile, String username, String type) throws IOException {
|
|
|
String fileMD5 = DigestUtils.md5Hex(multipartFile.getBytes());
|
|
String fileMD5 = DigestUtils.md5Hex(multipartFile.getBytes());
|
|
|
InsUploadFiles uploadFiles = getById(fileMD5);
|
|
InsUploadFiles uploadFiles = getById(fileMD5);
|