Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
file-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SuperHive
back-end
file-service
Commits
9f1fe97d
Commit
9f1fe97d
authored
May 25, 2020
by
huangcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alibaba druid版本由1.1.21升级到1.1.22
parent
89590c6c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
9 deletions
+15
-9
pom.xml
pom.xml
+7
-1
TestController.java
...v/freight/file/module/test/controller/TestController.java
+1
-1
bootstrap.yml
src/main/resources/bootstrap.yml
+4
-4
UploadControllerTest.java
...ght/file/module/file/controller/UploadControllerTest.java
+3
-3
No files found.
pom.xml
View file @
9f1fe97d
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<alibaba-nacos-discovery.version>
2.1.1.RELEASE
</alibaba-nacos-discovery.version>
<alibaba-nacos-discovery.version>
2.1.1.RELEASE
</alibaba-nacos-discovery.version>
<alibaba-nacos-config.version>
2.1.1.RELEASE
</alibaba-nacos-config.version>
<alibaba-nacos-config.version>
2.1.1.RELEASE
</alibaba-nacos-config.version>
<alibaba-fastjson.version>
1.2.62
</alibaba-fastjson.version>
<alibaba-fastjson.version>
1.2.62
</alibaba-fastjson.version>
<alibaba-druid.version>
1.1.2
1
</alibaba-druid.version>
<alibaba-druid.version>
1.1.2
2
</alibaba-druid.version>
<apache-commons-lang3.version>
3.7
</apache-commons-lang3.version>
<apache-commons-lang3.version>
3.7
</apache-commons-lang3.version>
<mybatisplus.version>
3.3.1
</mybatisplus.version>
<mybatisplus.version>
3.3.1
</mybatisplus.version>
</properties>
</properties>
...
@@ -110,6 +110,12 @@
...
@@ -110,6 +110,12 @@
<groupId>
com.baidu.aip
</groupId>
<groupId>
com.baidu.aip
</groupId>
<artifactId>
java-sdk
</artifactId>
<artifactId>
java-sdk
</artifactId>
<version>
4.12.0
</version>
<version>
4.12.0
</version>
<exclusions>
<exclusion>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-simple
</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependency>
</dependencies>
</dependencies>
...
...
src/main/java/com/esv/freight/file/module/test/controller/TestController.java
View file @
9f1fe97d
...
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
@Slf4j
@Slf4j
public
class
TestController
{
public
class
TestController
{
@
Ge
tMapping
(
"/ping"
)
@
Reques
tMapping
(
"/ping"
)
public
EResponse
ping
()
{
public
EResponse
ping
()
{
return
EResponse
.
ok
();
return
EResponse
.
ok
();
}
}
...
...
src/main/resources/bootstrap.yml
View file @
9f1fe97d
...
@@ -3,14 +3,14 @@ server:
...
@@ -3,14 +3,14 @@ server:
servlet
:
servlet
:
context-path
:
/file
context-path
:
/file
nacos
:
nacos
:
url
:
localhost
:8848
url
:
192.168.31.248
:8848
namespace
:
548b506d-8d19-4d54-9715-bb0ac3a655b2
namespace
:
aad5aa26-5351-4e7a-a65e-ecb332f3c52c
group
:
FREIGH
T_GROUP
group
:
DEFAUL
T_GROUP
spring
:
spring
:
application
:
application
:
name
:
freight-file-service
name
:
freight-file-service
profiles
:
profiles
:
active
:
dev
active
:
test
cloud
:
cloud
:
nacos
:
nacos
:
discovery
:
discovery
:
...
...
src/test/java/com/esv/freight/file/module/file/controller/UploadControllerTest.java
View file @
9f1fe97d
...
@@ -48,12 +48,12 @@ public class UploadControllerTest extends BaseTestController {
...
@@ -48,12 +48,12 @@ public class UploadControllerTest extends BaseTestController {
JSONObject
reqJson
=
new
JSONObject
();
JSONObject
reqJson
=
new
JSONObject
();
// 构造数据
// 构造数据
String
filepath
=
"D:\\test\\
1366x768_107480_8.jp
g"
;
String
filepath
=
"D:\\test\\
苏州英思唯智能科技有限公司沈阳分公司.pn
g"
;
File
file
=
new
File
(
filepath
);
File
file
=
new
File
(
filepath
);
InputStream
input
=
new
FileInputStream
(
file
);
InputStream
input
=
new
FileInputStream
(
file
);
reqJson
.
put
(
"fileType"
,
"image"
);
reqJson
.
put
(
"fileType"
,
"image"
);
reqJson
.
put
(
"fileData"
,
Base64
.
getEncoder
().
encodeToString
(
IOUtils
.
toByteArray
(
input
)));
reqJson
.
put
(
"fileData"
,
Base64
.
getEncoder
().
encodeToString
(
IOUtils
.
toByteArray
(
input
)));
reqJson
.
put
(
"fileName"
,
"
1366x768_107480_8.jpg
"
);
reqJson
.
put
(
"fileName"
,
"
苏州英思唯智能科技有限公司沈阳分公司-公章
"
);
MvcResult
mvcResult
=
this
.
getMockMvc
().
perform
(
MockMvcRequestBuilders
.
post
(
url
)
MvcResult
mvcResult
=
this
.
getMockMvc
().
perform
(
MockMvcRequestBuilders
.
post
(
url
)
.
contentType
(
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
.
contentType
(
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
...
@@ -111,7 +111,7 @@ public class UploadControllerTest extends BaseTestController {
...
@@ -111,7 +111,7 @@ public class UploadControllerTest extends BaseTestController {
InputStream
input
=
new
FileInputStream
(
file
);
InputStream
input
=
new
FileInputStream
(
file
);
reqJson
.
put
(
"fileType"
,
"word"
);
reqJson
.
put
(
"fileType"
,
"word"
);
reqJson
.
put
(
"fileData"
,
Base64
.
getEncoder
().
encodeToString
(
IOUtils
.
toByteArray
(
input
)));
reqJson
.
put
(
"fileData"
,
Base64
.
getEncoder
().
encodeToString
(
IOUtils
.
toByteArray
(
input
)));
reqJson
.
put
(
"fileName"
,
"线
下
合同-货主"
);
reqJson
.
put
(
"fileName"
,
"线
上
合同-货主"
);
MvcResult
mvcResult
=
this
.
getMockMvc
().
perform
(
MockMvcRequestBuilders
.
post
(
url
)
MvcResult
mvcResult
=
this
.
getMockMvc
().
perform
(
MockMvcRequestBuilders
.
post
(
url
)
.
contentType
(
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
.
contentType
(
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
...
...
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