Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
csbr-daop
/
ms-data-circulation-portal-service
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
3e05b567
authored
2025-10-30 17:40:38 +0800
by
xiaojie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
【数据资产】
1、上传文件到obs
1 parent
6f68c475
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
16 deletions
src/main/java/com/csbr/qingcloud/portal/controller/EnterpriseController.java
src/main/java/com/csbr/qingcloud/portal/feign/DaopCommonFeign.java
src/main/java/com/csbr/qingcloud/portal/service/impl/DataPortServiceImpl.java
src/main/java/com/csbr/qingcloud/portal/controller/EnterpriseController.java
View file @
3e05b56
...
...
@@ -220,15 +220,6 @@ public class EnterpriseController {
return
CommonRes
.
success
(
vo
);
}
@Autowired
private
DataPortService
dataPortService
;
@PostMapping
(
"/test"
)
public
CommonRes
test
(
@RequestBody
EnterpriseRegisterRQVO
enterpriseRegisterRQVO
)
{
dataPortService
.
test
(
enterpriseRegisterRQVO
);
return
CommonRes
.
success
(
true
);
}
//endregion
}
...
...
src/main/java/com/csbr/qingcloud/portal/feign/DaopCommonFeign.java
View file @
3e05b56
...
...
@@ -35,7 +35,7 @@ public interface DaopCommonFeign {
ResponseEntity
<
ByteArrayResource
>
downloadFile
(
@RequestParam
(
value
=
"filePath"
,
required
=
true
)
String
filePath
);
/**
* 上传
* 上传
(公有桶)
* @param image
* @return
*/
...
...
@@ -43,11 +43,11 @@ public interface DaopCommonFeign {
CommonRes
uploadImage
(
@RequestPart
MultipartFile
image
);
/**
* 上传
* 上传
(私有桶)
* @param file
* @return
*/
@RequestMapping
(
value
=
"/obs/upload-file-for-import"
,
method
=
RequestMethod
.
POST
,
consumes
=
MediaType
.
MULTIPART_FORM_DATA_VALUE
)
CommonRes
uploadFile
(
@RequestPart
MultipartFile
file
);
@RequestMapping
(
value
=
"/obs/upload-file-for-import
_base_name
"
,
method
=
RequestMethod
.
POST
,
consumes
=
MediaType
.
MULTIPART_FORM_DATA_VALUE
)
CommonRes
uploadFile
(
@RequestPart
MultipartFile
file
,
@RequestPart
String
fileName
);
}
...
...
src/main/java/com/csbr/qingcloud/portal/service/impl/DataPortServiceImpl.java
View file @
3e05b56
...
...
@@ -122,7 +122,7 @@ public class DataPortServiceImpl implements DataPortService {
}
else
{
String
fileName
=
"身份凭证.png"
;
MultipartFile
image
=
new
MockMultipartFile
(
fileName
,
fileName
,
"application/octet-stream"
,
resourceByteArray
);
String
url
=
(
String
)
daopCommonFeign
.
upload
Image
(
imag
e
).
getData
();
String
url
=
(
String
)
daopCommonFeign
.
upload
File
(
image
,
fileNam
e
).
getData
();
log
.
info
(
"======url======, {}"
,
url
);
LambdaUpdateWrapper
<
MfEnterprise
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
set
(
MfEnterprise:
:
getTrustedIdentityCredential
,
url
);
...
...
@@ -156,7 +156,7 @@ public class DataPortServiceImpl implements DataPortService {
}
}
else
{
MultipartFile
image
=
new
MockMultipartFile
(
"测试.png"
,
"测试,png"
,
"application/octet-stream"
,
resource
.
getByteArray
());
String
url
=
(
String
)
((
CommonRes
<?>)
daopCommonFeign
.
uploadFile
(
image
).
getData
()
).
getData
();
String
url
=
(
String
)
daopCommonFeign
.
uploadFile
(
image
,
"测试.png"
).
getData
();
log
.
info
(
"======url======, {}"
,
url
);
System
.
out
.
println
(
url
);
}
...
...
@@ -190,7 +190,7 @@ public class DataPortServiceImpl implements DataPortService {
}
else
{
String
fileName
=
"身份凭证.png"
;
MultipartFile
image
=
new
MockMultipartFile
(
fileName
,
fileName
,
"application/octet-stream"
,
resourceByteArray
);
String
url
=
(
String
)
daopCommonFeign
.
upload
Image
(
imag
e
).
getData
();
String
url
=
(
String
)
daopCommonFeign
.
upload
File
(
image
,
fileNam
e
).
getData
();
log
.
info
(
"======url======, {}"
,
url
);
LambdaUpdateWrapper
<
MfEnterprise
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
set
(
MfEnterprise:
:
getTrustedIdentityCredential
,
url
);
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment