Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-cloud
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data-hook
gic-cloud
Commits
5e2bfda7
Commit
5e2bfda7
authored
Jan 09, 2023
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:存储桶
parent
0d371ad2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
DownloadTaskServiceImpl.java
...cloud/data/hook/service/impl/DownloadTaskServiceImpl.java
+20
-0
No files found.
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/impl/DownloadTaskServiceImpl.java
View file @
5e2bfda7
...
@@ -2,6 +2,8 @@ package com.gic.cloud.data.hook.service.impl;
...
@@ -2,6 +2,8 @@ package com.gic.cloud.data.hook.service.impl;
import
cn.medubi.client.utils.LogPak
;
import
cn.medubi.client.utils.LogPak
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.gic.cloud.common.api.base.Page
;
import
com.gic.cloud.common.api.base.Page
;
import
com.gic.cloud.data.hook.api.dto.*
;
import
com.gic.cloud.data.hook.api.dto.*
;
import
com.gic.cloud.data.hook.api.entity.DownloadTaskStatus
;
import
com.gic.cloud.data.hook.api.entity.DownloadTaskStatus
;
...
@@ -99,9 +101,27 @@ public class DownloadTaskServiceImpl implements IDownloadTaskService {
...
@@ -99,9 +101,27 @@ public class DownloadTaskServiceImpl implements IDownloadTaskService {
result
.
setList
(
preResult
.
getList
());
// 设置数据集
result
.
setList
(
preResult
.
getList
());
// 设置数据集
result
.
setTotal
(
preResult
.
getTotal
());
// 设置总数
result
.
setTotal
(
preResult
.
getTotal
());
// 设置总数
result
.
setPageNum
(
preResult
.
getPageNum
());
// 设置当前页数
result
.
setPageNum
(
preResult
.
getPageNum
());
// 设置当前页数
if
(
CollectionUtils
.
isNotEmpty
(
result
.
getList
()))
{
for
(
DownloadTask
downloadTask
:
result
.
getList
())
{
downloadTask
.
setFilePath
(
getDownloadUrl
(
downloadTask
.
getFilePath
(),
downloadTask
.
getName
()));
}
}
return
result
;
return
result
;
}
}
private
String
getDownloadUrl
(
String
url
,
String
filename
)
{
Config
config
=
ConfigService
.
getConfig
(
"COMMON.cloud.file.setting"
);
String
hostUrl
=
config
.
getProperty
(
"gic.proxy.url"
,
null
);
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isBlank
(
hostUrl
))
{
return
url
;
}
else
{
int
pos
=
url
.
lastIndexOf
(
"."
);
String
ext
=
url
.
substring
(
pos
);
return
hostUrl
+
"/"
+
filename
+
ext
+
"?url="
+
url
;
}
}
/** 创建下载任务
/** 创建下载任务
* @param task
* @param task
* @return
* @return
...
...
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