Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
蒋勇
zhichan
Commits
7e7fe1a3
Commit
7e7fe1a3
authored
Dec 29, 2022
by
gxfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更换es配置打包发版
parent
8af604ee
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
20 deletions
+10
-20
alioss-java/src/main/java/com/example/aliossjava/common/CompanyNameUtils.java
+9
-10
alioss-java/target/alioss-java-0.0.1-SNAPSHOT.jar
+0
-0
alioss-java/target/alioss-java-0.0.1-SNAPSHOT.jar.original
+0
-0
alioss-java/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
+0
-8
alioss-java/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
+0
-1
alioss-java/target/surefire-reports/TEST-com.example.aliossjava.AliossJavaApplicationTests.xml
+0
-0
alioss-java/target/surefire-reports/com.example.aliossjava.AliossJavaApplicationTests.txt
+1
-1
No files found.
alioss-java/src/main/java/com/example/aliossjava/common/CompanyNameUtils.java
View file @
7e7fe1a3
package
com
.
example
.
aliossjava
.
common
;
import
com.alibaba.fastjson.JSONObject
;
import
org.apache.http.HttpHost
;
import
org.apache.http.auth.AuthScope
;
import
org.apache.http.auth.UsernamePasswordCredentials
;
...
...
@@ -16,7 +17,6 @@ import org.elasticsearch.client.RestHighLevelClient;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.search.SearchHits
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
...
...
@@ -59,13 +59,13 @@ public class CompanyNameUtils {
* @return
*/
public
static
Map
<
String
,
Object
>
querycompanyNanme
(
String
fieldKey
,
String
fieldnum
,
Integer
from
,
Integer
size
)
throws
Exception
{
if
(
fieldnum
==
null
||
""
.
equals
(
fieldnum
)){
if
(
fieldnum
==
null
||
""
.
equals
(
fieldnum
))
{
fieldnum
=
"不限"
;
}
CredentialsProvider
credentialsProvider
=
new
BasicCredentialsProvider
();
credentialsProvider
.
setCredentials
(
AuthScope
.
ANY
,
new
UsernamePasswordCredentials
(
"elastic"
,
"
w3OL+51eo*)c=^7
"
));
RestClientBuilder
client
=
RestClient
.
builder
(
new
HttpHost
(
"es-
cn-zz11nl9y20001gczg.public.elasticsearch.aliyuncs.com"
,
9200
))
new
UsernamePasswordCredentials
(
"elastic"
,
"
8TtEiDHHh2N8FFrVkADH
"
));
RestClientBuilder
client
=
RestClient
.
builder
(
new
HttpHost
(
"es-
bp.gongsibao.com"
,
443
,
"https"
))
.
setHttpClientConfigCallback
(
new
RestClientBuilder
.
HttpClientConfigCallback
()
{
@Override
public
HttpAsyncClientBuilder
customizeHttpClient
(
HttpAsyncClientBuilder
httpClientBuilder
)
{
...
...
@@ -73,7 +73,7 @@ public class CompanyNameUtils {
}
});
RestHighLevelClient
restClient
=
new
RestHighLevelClient
(
client
);
SearchRequest
searchRequest
=
new
SearchRequest
(
"
treasure_name
"
);
SearchRequest
searchRequest
=
new
SearchRequest
(
"
check_name_treasure_name_2020_10_28
"
);
searchRequest
.
types
(
"_doc"
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
if
(
fieldnum
.
equals
(
"不限"
)
&&
fieldKey
.
equals
(
""
))
{
...
...
@@ -102,14 +102,13 @@ public class CompanyNameUtils {
searchRequest
.
source
(
searchSourceBuilder
);
SearchResponse
searchResponse
=
restClient
.
search
(
searchRequest
,
RequestOptions
.
DEFAULT
);
List
<
String
>
result
=
new
LinkedList
<>();
SearchHits
searchHits
=
searchResponse
.
getHits
();
SearchHits
searchHits
=
searchResponse
.
getHits
();
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
searchHits
.
forEach
(
i
->
{
searchHits
.
forEach
(
i
->
{
result
.
add
(
i
.
getSourceAsString
());
});
hashMap
.
put
(
"companyName"
,
result
);
hashMap
.
put
(
"count"
,
searchHits
.
getTotalHits
().
value
);
hashMap
.
put
(
"companyName"
,
result
);
hashMap
.
put
(
"count"
,
searchHits
.
getTotalHits
().
value
);
return
hashMap
;
}
}
alioss-java/target/alioss-java-0.0.1-SNAPSHOT.jar
View file @
7e7fe1a3
No preview for this file type
alioss-java/target/alioss-java-0.0.1-SNAPSHOT.jar.original
View file @
7e7fe1a3
No preview for this file type
alioss-java/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
View file @
7e7fe1a3
com\example\aliossjava\common\CompanyNameUtils.class
com\example\aliossjava\common\TestUploadOssApi.class
com\example\aliossjava\controller\UploadController.class
com\example\aliossjava\common\UploadUtils.class
com\example\aliossjava\common\CompanyNameUtils$1.class
com\example\aliossjava\AliossJavaApplication.class
com\example\aliossjava\controller\CompanyNameController.class
com\example\aliossjava\common\AESUtils.class
alioss-java/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
View file @
7e7fe1a3
com\example\aliossjava\AliossJavaApplicationTests.class
alioss-java/target/surefire-reports/TEST-com.example.aliossjava.AliossJavaApplicationTests.xml
View file @
7e7fe1a3
This diff is collapsed.
Click to expand it.
alioss-java/target/surefire-reports/com.example.aliossjava.AliossJavaApplicationTests.txt
View file @
7e7fe1a3
-------------------------------------------------------------------------------
Test set: com.example.aliossjava.AliossJavaApplicationTests
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
2.816
s - in com.example.aliossjava.AliossJavaApplicationTests
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
1.583
s - in com.example.aliossjava.AliossJavaApplicationTests
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