|
|
@@ -27,15 +27,7 @@ import org.apache.http.auth.AuthScope;
|
|
|
import org.apache.http.auth.UsernamePasswordCredentials;
|
|
|
import org.apache.http.client.CredentialsProvider;
|
|
|
import org.apache.http.impl.client.BasicCredentialsProvider;
|
|
|
-// import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
|
|
|
-// import org.elasticsearch.action.search.SearchRequest;
|
|
|
-// import org.elasticsearch.action.search.SearchResponse;
|
|
|
-// import org.elasticsearch.client.RestClient;
|
|
|
-// import org.elasticsearch.client.RestClientBuilder;
|
|
|
-// import org.elasticsearch.client.RestHighLevelClient;
|
|
|
-// import org.elasticsearch.index.query.QueryBuilders;
|
|
|
-// import org.elasticsearch.search.SearchHit;
|
|
|
-// import org.elasticsearch.search.builder.SearchSourceBuilder;
|
|
|
+
|
|
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
@@ -222,63 +214,7 @@ public class TestController {
|
|
|
// + resObj.toJSONString());
|
|
|
// }
|
|
|
|
|
|
- // public static void main(String[] args) {
|
|
|
- // // 初始化RestHighLevelClient
|
|
|
- // RestClientBuilder builder = RestClient.builder(new HttpHost("172.16.1.150", 9200, "http"));
|
|
|
-
|
|
|
- // // 进行用户名密码的验证
|
|
|
- // CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
|
|
|
- // credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("elastic", "_Easy2024"));
|
|
|
- // builder.setHttpClientConfigCallback((HttpAsyncClientBuilder httpAsyncclientBuidler) -> httpAsyncclientBuidler
|
|
|
- // .setDefaultCredentialsProvider(credentialsProvider));
|
|
|
-
|
|
|
- // RestHighLevelClient client = new RestHighLevelClient(builder);
|
|
|
-
|
|
|
- // // 创建查询请求并设置索引名
|
|
|
- // SearchRequest searchRequest = new SearchRequest("gld_member");
|
|
|
+
|
|
|
|
|
|
- // // 构建查询条件
|
|
|
- // SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
|
|
|
- // searchSourceBuilder.query(QueryBuilders.matchQuery("user_id", "5600031"));
|
|
|
- // searchRequest.source(searchSourceBuilder);
|
|
|
-
|
|
|
- // // 执行查询
|
|
|
- // SearchResponse searchResponse;
|
|
|
- // try {
|
|
|
- // searchResponse = client.search(searchRequest);
|
|
|
- // // 处理查询结果
|
|
|
- // for (SearchHit hit : searchResponse.getHits().getHits()) {
|
|
|
- // System.out.println(hit.getSourceAsString());
|
|
|
- // }
|
|
|
- // } catch (IOException e) {
|
|
|
- // e.printStackTrace();
|
|
|
- // } finally {
|
|
|
- // // 关闭客户端
|
|
|
- // try {
|
|
|
- // client.close();
|
|
|
- // } catch (IOException e) {
|
|
|
- // e.printStackTrace();
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // ScheduledExecutorService executorService =
|
|
|
- // Executors.newScheduledThreadPool(2);
|
|
|
- // executorService.scheduleWithFixedDelay(() -> {
|
|
|
- // try {
|
|
|
- // pushFinance_W01001();
|
|
|
- // pushFinance_W01002();
|
|
|
- // pushFinance_W01004("202401");
|
|
|
- // pushFinance_W01004("202402");
|
|
|
- // pushFinance_W01004("202403");
|
|
|
- // pushFinance_W01004("202404");
|
|
|
- // pushFinance_W01004("202405");
|
|
|
- // pushFinance_W01004("202406");
|
|
|
- // pushFinance_W01004("202407");
|
|
|
- // pushFinance_W01004("202408");
|
|
|
- // pushFinance_W01003();
|
|
|
- // } catch (Exception e) {
|
|
|
- // e.printStackTrace();
|
|
|
- // }
|
|
|
- // }, 0, 20, TimeUnit.SECONDS);
|
|
|
+
|
|
|
}
|