|
@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
import org.dromara.common.oss.core.OssClient; |
|
|
import org.dromara.common.oss.core.OssClient; |
|
|
import org.dromara.common.oss.factory.OssFactory; |
|
|
import org.dromara.common.oss.factory.OssFactory; |
|
|
|
|
|
import org.dromara.common.redis.utils.RedisOpsUtils; |
|
|
import org.dromara.common.satoken.utils.LoginHelper; |
|
|
import org.dromara.common.satoken.utils.LoginHelper; |
|
|
import org.dromara.common.sdk.cloudapi.device.DeviceEnum; |
|
|
import org.dromara.common.sdk.cloudapi.device.DeviceEnum; |
|
|
import org.dromara.common.sdk.cloudapi.media.FlightTask; |
|
|
import org.dromara.common.sdk.cloudapi.media.FlightTask; |
|
@ -51,6 +52,7 @@ public class FileServiceImpl implements IFileService { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private IDeviceProService deviceProService; |
|
|
private IDeviceProService deviceProService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Optional<MediaFileEntity> getMediaByFingerprint(String workspaceId, String fingerprint) { |
|
|
private Optional<MediaFileEntity> getMediaByFingerprint(String workspaceId, String fingerprint) { |
|
|
MediaFileEntity fileEntity = mapper.selectOne(new LambdaQueryWrapper<MediaFileEntity>() |
|
|
MediaFileEntity fileEntity = mapper.selectOne(new LambdaQueryWrapper<MediaFileEntity>() |
|
|
.eq(MediaFileEntity::getWorkspaceId, workspaceId) |
|
|
.eq(MediaFileEntity::getWorkspaceId, workspaceId) |
|
@ -73,6 +75,10 @@ public class FileServiceImpl implements IFileService { |
|
|
@Override |
|
|
@Override |
|
|
public Integer saveFile(String workspaceId, MediaUploadCallbackRequest file, FlightTask flightTask,Integer proId) { |
|
|
public Integer saveFile(String workspaceId, MediaUploadCallbackRequest file, FlightTask flightTask,Integer proId) { |
|
|
MediaFileEntity fileEntity = this.fileUploadConvertToEntity(file,flightTask); |
|
|
MediaFileEntity fileEntity = this.fileUploadConvertToEntity(file,flightTask); |
|
|
|
|
|
if(RedisOpsUtils.checkExist("jobId-media:"+fileEntity.getJobId()+fileEntity.getFileName())) { |
|
|
|
|
|
return 1; |
|
|
|
|
|
} |
|
|
|
|
|
RedisOpsUtils.setWithExpire("jobId-media:"+fileEntity.getJobId()+fileEntity.getFileName(),fileEntity.getObjectKey(),10800); |
|
|
fileEntity.setWorkspaceId(workspaceId); |
|
|
fileEntity.setWorkspaceId(workspaceId); |
|
|
fileEntity.setFileId(UUID.randomUUID().toString()); |
|
|
fileEntity.setFileId(UUID.randomUUID().toString()); |
|
|
fileEntity.setProId(proId); |
|
|
fileEntity.setProId(proId); |
|
|