Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kyb-search
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
0
Merge Requests
0
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
万建斌
kyb-search
Commits
a9ed6b31
Commit
a9ed6b31
authored
Oct 23, 2019
by
万建斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2019-10-21 优化
parent
1364a54c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
EsMapper.java
src/main/java/com/cesgroup/kingkong/mapper/EsMapper.java
+5
-4
application-dev.yml
src/main/resources/application-dev.yml
+3
-0
No files found.
src/main/java/com/cesgroup/kingkong/mapper/EsMapper.java
View file @
a9ed6b31
...
...
@@ -14,6 +14,9 @@ import com.cesgroup.common.utils.http.HttpClientHelper;
public
class
EsMapper
{
@Value
(
"${elasticsearch.HostAddress}"
)
private
String
esHostAddress
=
"http://10.250.190.97:18630"
;
@Value
(
"${articlesearch.HostAddress}"
)
private
String
arHostAddress
=
""
;
@Autowired
private
HttpClientHelper
httpClientHelper
;
...
...
@@ -25,7 +28,6 @@ public class EsMapper {
return
result
;
}
public
String
getArticleInfo
()
{
String
uriString
=
"https://api.elsevier.com/content/search/scopus"
;
//String uriString =esHostAddress+"/"+"testhbase*/"+"_search/";
HashMap
<
String
,
Object
>
header
=
new
HashMap
<
String
,
Object
>();
HashMap
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
...
...
@@ -33,17 +35,16 @@ public class EsMapper {
paramMap
.
put
(
"count"
,
25
);
paramMap
.
put
(
"query"
,
"AFFILCITY(beijing)"
);
header
.
put
(
"X-ELS-APIKey"
,
"d7513bc36ec90aa7662c0cfb28b3dd3b"
);
String
result
=
httpClientHelper
.
get
(
uriString
,
paramMap
,
header
);
String
result
=
httpClientHelper
.
get
(
arHostAddress
,
paramMap
,
header
);
return
result
;
}
public
String
getArticleInfo
(
HashMap
<
String
,
Object
>
paramMap
){
String
uriString
=
"https://api.elsevier.com/content/search/scopus"
;
HashMap
<
String
,
Object
>
header
=
new
HashMap
<
String
,
Object
>();
header
.
put
(
"X-ELS-APIKey"
,
"d7513bc36ec90aa7662c0cfb28b3dd3b"
);
header
.
put
(
"Content-Type"
,
"application/json"
);
header
.
put
(
"Accept"
,
"application/json"
);
String
result
=
httpClientHelper
.
get
(
uriString
,
paramMap
,
header
);
String
result
=
httpClientHelper
.
get
(
arHostAddress
,
paramMap
,
header
);
return
result
;
}
}
src/main/resources/application-dev.yml
View file @
a9ed6b31
...
...
@@ -10,6 +10,7 @@ spring:
# maxActive: 20
# mysql
url
:
jdbc:mysql://10.11.0.49:3306/zl_search?useUnicode=true&characterEncoding=utf-8&useSSL=false
# url: jdbc:mysql://127.0.0.1:3306/kyb_search?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
username
:
root
password
:
root
driverClassName
:
com.mysql.jdbc.Driver
...
...
@@ -17,6 +18,8 @@ spring:
elasticsearch
:
#HostAddress: http://180.168.156.212:30020
HostAddress
:
http://172.16.60.3:32668
articlesearch
:
HostAddress
:
https://api.elsevier.com/content/search/scopus
http
:
maxTotal
:
100
defaultMaxPerRoute
:
20
...
...
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