Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
poc
poc-api
Commits
97bdf635
Commit
97bdf635
authored
Nov 05, 2025
by
R10
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release_gdghg' of
ssh://gitlab.gsstcloud.com:10022/poc/poc-api
into release_gdghg
parents
bbfe7c40
2f89aae4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
MinerUAPI.java
.../cn/com/poc/thirdparty/resource/minerU/api/MinerUAPI.java
+24
-2
No files found.
src/main/java/cn/com/poc/thirdparty/resource/minerU/api/MinerUAPI.java
View file @
97bdf635
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
minerU
.
api
;
import
cn.com.poc.common.service.RedisService
;
import
cn.com.poc.common.utils.JsonUtils
;
import
cn.com.poc.common.utils.StringUtils
;
import
cn.com.poc.thirdparty.resource.baidu.api.BaiduTextDiffApi
;
...
...
@@ -7,6 +8,7 @@ import cn.com.poc.thirdparty.resource.baidu.entity.result.BaiduTextDiffResult;
import
cn.com.poc.thirdparty.resource.minerU.MinerUResponse
;
import
cn.com.poc.thirdparty.resource.minerU.MinerUResult
;
import
cn.com.yict.framemax.core.exception.BusinessException
;
import
cn.com.yict.framemax.frame.service.FmxParamConfigService
;
import
com.google.gson.Gson
;
import
okhttp3.*
;
import
org.slf4j.Logger
;
...
...
@@ -15,6 +17,7 @@ import org.springframework.security.core.parameters.P;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.Assert
;
import
javax.annotation.Resource
;
import
java.io.File
;
import
java.io.IOException
;
import
java.nio.file.Files
;
...
...
@@ -32,7 +35,26 @@ public class MinerUAPI {
public
final
OkHttpClient
HTTP_CLIENT
=
new
OkHttpClient
().
newBuilder
().
readTimeout
(
10
*
60
,
TimeUnit
.
SECONDS
).
build
();
private
String
MinerU_URL
=
"http://i-2.gpushare.com:53865/file_parse"
;
private
String
BASE_URL_PARAM_CODE
=
"mineru_base_url"
;
private
String
BASE_URL_CACHE_KEY
=
"MINERU_BASE_URL"
;
@Resource
private
RedisService
redisService
;
@Resource
private
FmxParamConfigService
fmxParamConfigService
;
private
String
getMinerU_URL
()
{
if
(
redisService
.
hasKey
(
BASE_URL_CACHE_KEY
))
{
return
redisService
.
get
(
BASE_URL_CACHE_KEY
).
toString
();
}
String
baseURL
=
fmxParamConfigService
.
getParam
(
BASE_URL_PARAM_CODE
);
redisService
.
set
(
BASE_URL_CACHE_KEY
,
baseURL
,
600
);
return
baseURL
;
}
public
MinerUResult
parsePDF
(
MinerUResponse
minerUResponse
)
{
MultipartBody
.
Builder
builder
=
new
MultipartBody
.
Builder
().
setType
(
MultipartBody
.
FORM
);
...
...
@@ -59,7 +81,7 @@ public class MinerUAPI {
MultipartBody
body
=
builder
.
build
();
Request
request
=
new
Request
.
Builder
()
.
url
(
MinerU_URL
)
.
url
(
getMinerU_URL
()
+
"file_parse"
)
.
method
(
"POST"
,
body
)
.
addHeader
(
"Content-Type"
,
"multipart/form-data"
)
.
build
();
...
...
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