Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GeoFlyApi
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GeoFly
GeoFlyApi
Commits
e73893f6
Commit
e73893f6
authored
Mar 05, 2026
by
gdj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
尝试修改oss文件回传问题。
parent
c5d9d9ee
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletions
+16
-1
sample/src/main/java/com/dji/sample/media/service/impl/MediaServiceImpl.java
+16
-1
No files found.
sample/src/main/java/com/dji/sample/media/service/impl/MediaServiceImpl.java
View file @
e73893f6
...
...
@@ -196,7 +196,12 @@ public class MediaServiceImpl extends AbstractMediaService implements IMediaServ
file
.
setPath
(
path
);
file
.
setObjectKey
(
moveFilePath
+
"/"
+
callback
.
getFile
().
getName
());
try
{
moveFile
(
orgFilePath
,
moveFilePath
,
callback
.
getFile
().
getName
());
}
catch
(
Exception
e
)
{
log
.
error
(
"Failed to move file for temporary task: {}"
,
e
.
getMessage
());
// 继续执行,不中断流程
}
}
else
{
// 查询 任务的orgId
String
orgId
=
""
;
...
...
@@ -227,7 +232,12 @@ public class MediaServiceImpl extends AbstractMediaService implements IMediaServ
file
.
setPath
(
path
);
file
.
setObjectKey
(
moveFilePath
+
"/"
+
callback
.
getFile
().
getName
());
try
{
moveFile
(
orgFilePath
,
moveFilePath
,
callback
.
getFile
().
getName
());
}
catch
(
Exception
e
)
{
log
.
error
(
"Failed to move file for wayline job: {}"
,
e
.
getMessage
());
// 继续执行,不中断流程
}
}
else
{
file
.
setPath
(
path
);
}
...
...
@@ -243,12 +253,17 @@ public class MediaServiceImpl extends AbstractMediaService implements IMediaServ
boolean
created
=
directory
.
mkdirs
();
}
Path
source
=
Paths
.
get
(
basePath
,
OssConfiguration
.
bucket
,
sourceFilePath
,
fileName
);
// 检查源文件是否存在
if
(!
Files
.
exists
(
source
))
{
log
.
warn
(
"Source file does not exist: {}"
,
source
);
return
;
// 源文件不存在时直接返回,不抛出异常
}
Path
targetDir
=
Paths
.
get
(
basePath
,
OssConfiguration
.
bucket
,
targetFilePath
);
if
(!
Files
.
exists
(
targetDir
))
{
Files
.
createDirectories
(
targetDir
);
}
Path
target
=
targetDir
.
resolve
(
fileName
);
Files
.
move
(
source
,
target
,
StandardCopyOption
.
REPLACE_EXISTING
);
Files
.
copy
(
source
,
target
,
StandardCopyOption
.
REPLACE_EXISTING
);
}
private
void
notifyUploadedCount
(
MediaFileCountDTO
mediaFileCount
,
TopicEventsRequest
<
FileUploadCallback
>
request
,
String
jobId
,
DeviceDTO
dock
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment