Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
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
8timerv2
8timerapiv200
Commits
641944e6
Commit
641944e6
authored
Jan 10, 2022
by
284718418@qq.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
e9379318
30ac1fbb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
src/main/java/cn/timer/api/controller/disk/DiskFilesController.java
+4
-1
src/main/java/cn/timer/api/controller/htzz/HtzzController.java
+17
-4
No files found.
src/main/java/cn/timer/api/controller/disk/DiskFilesController.java
View file @
641944e6
...
@@ -68,6 +68,9 @@ public class DiskFilesController {
...
@@ -68,6 +68,9 @@ public class DiskFilesController {
@ApiOperation
(
value
=
"上传普通文件"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperation
(
value
=
"上传普通文件"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
upload
(
@CurrentUser
UserBean
userBean
,
@RequestParam
(
required
=
true
)
MultipartFile
[]
file
,
public
Result
<
Object
>
upload
(
@CurrentUser
UserBean
userBean
,
@RequestParam
(
required
=
true
)
MultipartFile
[]
file
,
@ApiParam
(
"文件文件夹或共享空间ID"
)
@RequestParam
(
required
=
true
)
Integer
catalogueId
)
{
@ApiParam
(
"文件文件夹或共享空间ID"
)
@RequestParam
(
required
=
true
)
Integer
catalogueId
)
{
if
(
catalogueId
<=
0
){
return
ResultUtil
.
error
(
"上传失败,请选择文件夹"
);
}
if
(
file
==
null
||
file
.
length
==
0
)
{
if
(
file
==
null
||
file
.
length
==
0
)
{
return
ResultUtil
.
error
(
"上传失败,请选择上传文件"
);
return
ResultUtil
.
error
(
"上传失败,请选择上传文件"
);
}
}
...
@@ -108,7 +111,7 @@ public class DiskFilesController {
...
@@ -108,7 +111,7 @@ public class DiskFilesController {
diskFilesLog
.
insert
();
diskFilesLog
.
insert
();
}
}
return
ResultUtil
.
data
(
imageUrl
s
);
return
ResultUtil
.
data
(
diskFile
s
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
src/main/java/cn/timer/api/controller/htzz/HtzzController.java
View file @
641944e6
...
@@ -9,10 +9,12 @@ import com.google.common.base.Strings;
...
@@ -9,10 +9,12 @@ import com.google.common.base.Strings;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
io.swagger.models.auth.In
;
import
io.swagger.models.auth.In
;
import
org.bouncycastle.util.encoders.UrlBase64Encoder
;
import
org.bouncycastle.util.encoders.UrlBase64Encoder
;
import
org.eclipse.jetty.util.StringUtil
;
import
org.eclipse.jetty.util.UrlEncoded
;
import
org.eclipse.jetty.util.UrlEncoded
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
@@ -64,6 +66,8 @@ public class HtzzController {
...
@@ -64,6 +66,8 @@ public class HtzzController {
private
String
project_package
;
private
String
project_package
;
@Value
(
"${zip.path}"
)
@Value
(
"${zip.path}"
)
private
String
zipPath
;
private
String
zipPath
;
@Value
(
"${config-8timer.Aliyun.endpoint}"
)
private
String
endpoint
;
/**
/**
...
@@ -305,12 +309,21 @@ public class HtzzController {
...
@@ -305,12 +309,21 @@ public class HtzzController {
return
ResultUtil
.
error
(
"操作失败"
);
return
ResultUtil
.
error
(
"操作失败"
);
}
}
Map
<
String
,
String
>
url
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
url
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
ftp
=
Maps
.
newHashMap
();
ids
.
forEach
(
i
->
{
ids
.
forEach
(
i
->
{
HtzzAdminZzda
htzzAdminZzda
=
HtzzAdminZzda
.
builder
().
id
(
i
).
build
().
selectById
();
HtzzAdminZzda
htzzAdminZzda
=
HtzzAdminZzda
.
builder
().
id
(
i
).
build
().
selectById
();
/*格式化获取文字*/
if
(
StringUtil
.
isNotBlank
(
htzzAdminZzda
.
getZjfj
())){
String
urla
=
UrlEncoded
.
decodeString
(
htzzAdminZzda
.
getZjfj
());
/*格式化获取文字*/
int
index
=
urla
.
indexOf
(
project_package
);
String
urla
=
UrlEncoded
.
decodeString
(
htzzAdminZzda
.
getZjfj
());
url
.
put
(
htzzAdminZzda
.
getId
()
+
"_"
+
htzzAdminZzda
.
getZjmc
(),
urla
.
substring
(
index
));
/*判断是保存在oss还是ftp*/
if
(
urla
.
contains
(
endpoint
.
replace
(
"http://"
,
"."
)))
{
int
index
=
urla
.
indexOf
(
project_package
);
url
.
put
(
htzzAdminZzda
.
getId
()
+
"_"
+
htzzAdminZzda
.
getZjmc
(),
urla
.
substring
(
index
));
}
else
{
//TODO 区分出云盘文件暂时不下载
ftp
.
put
(
htzzAdminZzda
.
getId
()+
"_"
+
htzzAdminZzda
.
getZjmc
(),
urla
);
}
}
});
});
String
zipUrl
=
null
;
String
zipUrl
=
null
;
try
{
try
{
...
...
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