Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-backend
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
AutogeneralShanghai
yd-backend
Commits
e7a1ca94
Commit
e7a1ca94
authored
Mar 31, 2021
by
yao.xiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试-富文本
parent
001bb210
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
yd-api/src/main/java/com/yd/api/agms/AgmsController.java
+2
-1
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsSharingServiceImpl.java
+4
-4
No files found.
yd-api/src/main/java/com/yd/api/agms/AgmsController.java
View file @
e7a1ca94
...
...
@@ -19,6 +19,7 @@ import com.yd.api.agms.vo.statistics.FinancialStatisticsResponseVO;
import
com.yd.api.agms.vo.statistics.LeadsStatisticsRequestVO
;
import
com.yd.api.agms.vo.statistics.LeadsStatisticsResponseVO
;
import
com.yd.api.result.JsonResult
;
import
com.yd.util.CommonUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -297,7 +298,7 @@ public class AgmsController {
@RequestMapping
(
value
=
"/controller"
)
public
Object
controller
(
@RequestParam
String
action
,
@RequestParam
(
required
=
false
)
String
callback
,
@RequestParam
(
value
=
"upfile"
,
required
=
false
)
MultipartFile
upfile
)
{
ControllerResponseVO
responseVO
=
agmsSharingService
.
controller
(
action
,
upfile
);
if
(
"config"
.
equals
(
action
))
{
if
(
!
CommonUtil
.
isNullOrBlank
(
callback
))
{
return
callback
+
"("
+
JSON
.
toJSONString
(
responseVO
)
+
")"
;
}
return
responseVO
;
...
...
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsSharingServiceImpl.java
View file @
e7a1ca94
...
...
@@ -97,7 +97,7 @@ public class AgmsSharingServiceImpl implements AgmsSharingService {
responseVO
.
setFileManagerAllowFiles
(
Arrays
.
asList
(
fileAllowFiles
));
}
else
if
(
"uploadimage"
.
equals
(
action
)){
try
{
String
type
=
upfile
.
getOriginalFilename
().
substring
(
upfile
.
getOriginalFilename
().
indexOf
(
"."
)
+
1
);
String
type
=
upfile
.
getOriginalFilename
().
substring
(
upfile
.
getOriginalFilename
().
indexOf
(
"."
)
);
byte
[]
bytes
=
upfile
.
getBytes
();
InputStream
in
=
new
ByteArrayInputStream
(
bytes
);
StringBuilder
key
=
new
StringBuilder
(
"sharing/"
);
...
...
@@ -105,17 +105,17 @@ public class AgmsSharingServiceImpl implements AgmsSharingService {
Date
date
=
new
Date
();
SimpleDateFormat
sd
=
new
SimpleDateFormat
(
"yyyyMMddHHmmssSSS"
);
String
nowTime
=
sd
.
format
(
date
);
if
(
Arrays
.
asList
(
imageAllowFiles
).
contains
(
"."
+
type
)){
if
(
Arrays
.
asList
(
imageAllowFiles
).
contains
(
type
)){
title
=
nowTime
+
(
int
)(
Math
.
random
()*
1000000
);
key
.
append
(
"image/"
).
append
(
title
);
}
else
if
(
Arrays
.
asList
(
videoAllowFiles
).
contains
(
"."
+
type
)){
}
else
if
(
Arrays
.
asList
(
videoAllowFiles
).
contains
(
type
)){
title
=
nowTime
+
(
int
)(
Math
.
random
()*
1000000
);
key
.
append
(
"video/"
).
append
(
title
);
}
else
{
title
=
nowTime
+
(
int
)(
Math
.
random
()*
1000000
);
key
.
append
(
"file/"
).
append
(
title
);
}
String
putFileToOss
=
ossService
.
putFileToOss
(
null
,
key
.
toString
()
+
"."
+
type
,
in
);
String
putFileToOss
=
ossService
.
putFileToOss
(
null
,
key
.
toString
()
+
type
,
in
);
responseVO
.
setState
(
"SUCCESS"
);
responseVO
.
setUrl
(
putFileToOss
);
responseVO
.
setTitle
(
title
);
...
...
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