You've already forked FrameTour-BE
修改
This commit is contained in:
@@ -10,8 +10,6 @@ public interface TaskFaceService {
|
||||
|
||||
SearchFaceRespVo searchFace(IFaceBodyAdapter adapter, String dbName, String faceUrl, String reason);
|
||||
|
||||
String uploadFile(MultipartFile file, Long userId);
|
||||
|
||||
boolean deleteFaceSample(Long scenicId, String dbName, String entityId);
|
||||
|
||||
boolean assureFaceDb(IFaceBodyAdapter faceBodyAdapter, String dbName);
|
||||
|
@@ -289,30 +289,6 @@ public class TaskFaceServiceImpl implements TaskFaceService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String uploadFile(MultipartFile file, Long userId) {
|
||||
if (file.isEmpty()) {
|
||||
throw new RuntimeException("文件不存在!");
|
||||
}
|
||||
String originalFilename = file.getOriginalFilename();
|
||||
//获取文件名后缀
|
||||
String suffix = originalFilename.split("\\.")[1];
|
||||
if ("Jpeg".equals(suffix)) {
|
||||
suffix = "jpg";
|
||||
}
|
||||
//文件储存路径
|
||||
String filePath = StorageUtil.joinPath("user-faces", DateUtils.format(new Date(),"yyyy-MM-dd"));
|
||||
// 生成文件名
|
||||
String fileName= userId + "." + suffix;
|
||||
IStorageAdapter adapter = StorageFactory.use("faces");
|
||||
try {
|
||||
return adapter.uploadFile(file.getInputStream(), filePath, fileName);
|
||||
} catch (IOException e) {
|
||||
log.error("文件上传失败!", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteFaceSample(Long scenicId, String dbName, String entityId) {
|
||||
ScenicConfigEntity scenicConfig = scenicRepository.getScenicConfig(scenicId);
|
||||
|
Reference in New Issue
Block a user