SpringBoot--中间件技术-3:整合mongodb,整合ElasticSearch,附案例含代码(简单易懂)

SpringBoot整合mongodb

实现步骤:

  1. pom文件导坐标

    <!--mongo-->
    <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-mongodb</artifactId>
    </dependency>
    <dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId>
    </dependency>
    <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope>
    </dependency>
    
  2. yaml配置文件配置mongodb:

    spring:data:mongodb:uri: mongodb://localhost/spring
    
  3. 随便建一个pojo

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public class Book {private int id;private String name;private String type;private String description;
    }
    
  4. 测试:

    @SpringBootTest
    class SpringbootMongodb01ApplicationTests {@Autowired(required = false)private MongoTemplate mongoTemplate;@Testvoid contextLoads() {Book book = new Book();book.setId(4);book.setName("董健翔");book.setType("牛逼");book.setDescription("真牛逼");mongoTemplate.save(book);}@Testvoid find(){List<Book> all = mongoTemplate.findAll(Book.class);System.out.println(all);}
    }
    

    装配MongoTemplate模板类,调用方法

整合MongoDB总结:

  1. 导坐标
  2. 写配置文件
  3. 核心类MongoTemplate调用

SpringBoot整合ElasticSearch

前提准备:数据库+ES

数据库建表语句:

DROP TABLE IF EXISTS `tb_hotel`;
CREATE TABLE `tb_hotel`  (`id` bigint(20) NOT NULL COMMENT '酒店id',`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '酒店名称',`address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '酒店地址',`price` int(10) NOT NULL COMMENT '酒店价格',`score` int(2) NOT NULL COMMENT '酒店评分',`brand` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '酒店品牌',`city` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '所在城市',`star_name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '酒店星级,1星到5星,1钻到5钻',`business` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商圈',`latitude` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '纬度',`longitude` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '经度',`pic` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '酒店图片',PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Compact;

实现步骤:

  1. pom文件到坐标

    <properties><!--锁定jdk版本--><java.version>1.8</java.version><!--锁定es版本--><elasticsearch.version>7.12.0</elasticsearch.version>
    </properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>org.elasticsearch.client</groupId><artifactId>elasticsearch-rest-high-level-client</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId><version>3.4.2</version></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>8.0.29</version></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><optional>true</optional></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId></dependency><!--FastJson--><dependency><groupId>com.alibaba</groupId><artifactId>fastjson</artifactId><version>1.2.71</version></dependency>
    </dependencies>
    
  2. yaml配置文件

    spring:datasource:driver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://localhost:3306/spring?serverTimezone=GMTusername: rootpassword: 123456
    logging:level:com.dong: debug
    mybatis-plus:configuration:map-underscore-to-camel-case: truetype-aliases-package: com.dong.pojo
    
  3. 创建实体类:

    对应数据库表的实体类

    @NoArgsConstructor
    @AllArgsConstructor
    @Data
    @TableName("tb_hotel")
    public class Hotel {@TableId(type = IdType.INPUT)private Long id;private String name;private String address;private Integer price;private Integer score;private String brand;private String city;private String starName;private String business;private String longitude;//经度private String latitude;//纬度private String pic;
    }
    

    对应ES的实体类

    @Data
    @NoArgsConstructor
    public class HotelDoc {private Long id;private String name;private String address;private Integer price;private Integer score;private String brand;private String city;private String starName;private String business;private String location;private String pic;
    // 构造方法用于类型转换   将数据库中的经、纬度用坐标location代替,所以HotelDoc稍有不同public HotelDoc(Hotel hotel){   this.id = hotel.getId();this.name = hotel.getName();this.address = hotel.getAddress();this.price = hotel.getPrice();this.score = hotel.getScore();this.brand = hotel.getBrand();this.city = hotel.getCity();this.starName = hotel.getStarName();this.business = hotel.getBusiness();this.location = hotel.getLatitude() + ", "+ hotel.getLongitude();this.pic = hotel.getPic();}
    }
    
  4. mapper层:

    @Mapper
    public interface HotelMapper extends BaseMapper<Hotel> {
    }
    
  5. service层:

    接口:

    public interface IHotelService extends IService<Hotel> {
    }
    

    实现类:

    @Service
    public class HotelServiceImp extends ServiceImpl<HotelMapper, Hotel> implements IHotelService {
    }
    
  6. 演示在juint中进行,演示对索引库和文档的操作

索引库的操作

  • 判断索引库是否存在(其实就是查询)
  • 创建索引库
  • 删除索引库
@SpringBootTest
class SpringbootEs01ApplicationTests {// 操作es的核心对象private RestHighLevelClient client;// 单元测试之前都执行的,告诉核心对象es的端口号  固定语法@BeforeEachvoid setUp(){this.client = new RestHighLevelClient(RestClient.builder(HttpHost.create("http://localhost:9200")));}// 单元测试之后都执行的@AfterEachvoid tearDown() throws Exception{this.client.close();}// 判断索引库是否存在@Testvoid testExistsHotelIndex() throws Exception {GetIndexRequest request = new GetIndexRequest("hotels");boolean exists = client.indices().exists(request, RequestOptions.DEFAULT);System.err.println(exists ? "索引库已经存在":"索引库不存在");}// 创建索引库@Testvoid createHotelIndex() throws Exception{// 创建Request对象CreateIndexRequest request = new CreateIndexRequest("hotels");// 准备请求的参数:DSL语句request.source(HotelConstants.MAPPING_TEMPLATE, XContentType.JSON);// 发送请求client.indices().create(request,RequestOptions.DEFAULT);}// 删除索引库@Testvoid delteHotelIndex() throws Exception{// 创建Request对象DeleteIndexRequest request = new DeleteIndexRequest("hotels");// 发送请求client.indices().delete(request,RequestOptions.DEFAULT);}
}

创建索引库的时候需要映射,映射往往是一个复杂且长的JSON,所以单独写个类,上面创建索引库的映射如下

可以在postman中写好粘贴过来

public class HotelConstants {public static final String MAPPING_TEMPLATE = "{\n" +"  \"mappings\": {\n" +"    \"properties\": {\n" +"      \"id\": {\n" +"        \"type\": \"keyword\"\n" +"      },\n" +"      \"name\":{\n" +"        \"type\": \"text\",\n" +"        \"analyzer\": \"ik_max_word\",\n" +"        \"copy_to\": \"all\"\n" +"      },\n" +"      \"address\":{\n" +"        \"type\": \"keyword\",\n" +"        \"index\": false\n" +"      },\n" +"      \"price\":{\n" +"        \"type\": \"integer\"\n" +"      },\n" +"      \"score\":{\n" +"        \"type\": \"integer\"\n" +"      },\n" +"      \"brand\":{\n" +"        \"type\": \"keyword\",\n" +"        \"copy_to\": \"all\"\n" +"      },\n" +"      \"city\":{\n" +"        \"type\": \"keyword\",\n" +"        \"copy_to\": \"all\"\n" +"      },\n" +"      \"starName\":{\n" +"        \"type\": \"keyword\"\n" +"      },\n" +"      \"business\":{\n" +"        \"type\": \"keyword\"\n" +"      },\n" +"      \"location\":{\n" +"        \"type\": \"geo_point\"\n" +"      },\n" +"      \"pic\":{\n" +"        \"type\": \"keyword\",\n" +"        \"index\": false\n" +"      },\n" +"      \"all\":{\n" +"        \"type\": \"text\",\n" +"        \"analyzer\": \"ik_max_word\"\n" +"      }\n" +"    }\n" +"  }\n" +"}";
}

文档的操作

@SpringBootTest
public class HotelDocumentTests {// 核心对象private RestHighLevelClient client;// 需要从数据库中查数据存入es,装配业务@Autowired(required = false)private IHotelService service;@BeforeEachvoid setUp(){this.client = new RestHighLevelClient(RestClient.builder(HttpHost.create("http://localhost:9200")));}@AfterEachvoid tearDown() throws  Exception{this.client.close();}// 从数据库新增一条数据到es@Testvoid addDocument() throws Exception{// 从数据库查询一条数据Hotel hotel = service.getById(395434);System.out.println(hotel);// 转换为文档类型HotelDoc hotelDoc = new HotelDoc(hotel);// 将文档类型转为JSON格式String json = JSON.toJSONString(hotelDoc);// 准备request请求对象IndexRequest request = new IndexRequest("hotels").id(hotelDoc.getId().toString());// 准备JSON文档request.source(json, XContentType.JSON);// 发送请求client.index(request, RequestOptions.DEFAULT);}// 从es中删除一条数据@Testvoid deleteDocument() throws Exception{// 准备删除请求RequestDeleteRequest request = new DeleteRequest("hotels", "395434");// 发送请求client.delete(request,RequestOptions.DEFAULT);}// 修改es中的数据@Testvoid updateDocument() throws  Exception{// 准备修改请求UpdateRequestUpdateRequest request = new UpdateRequest("hotels", "395434");// 准备请求参数(要修改的数据内容)request.doc("name","W酒店","city","西安","price","2000","starName","五星级");// 发送请求client.update(request, RequestOptions.DEFAULT);}// 从es中查询一条数据@Testvoid getDocumentById() throws  Exception{// 准备查询请求GetRequestGetRequest getRequest = new GetRequest("hotels", "395434");// 发送请求,得到响应GetResponse response = client.get(getRequest, RequestOptions.DEFAULT);// 解析响应结果String json = response.getSourceAsString();HotelDoc hotelDoc = JSON.parseObject(json,HotelDoc.class);System.out.println(hotelDoc);}// 批量新增数据到es@Testvoid addAllDocument() throws  Exception{// 数据库全查List<Hotel> hotels = service.list();// 准备请求BulkRequest bulkRequest = new BulkRequest();// 准备参数for(Hotel hotel : hotels){// 类型转化HotelDoc hotelDoc = new HotelDoc(hotel);// 请求添加数据bulkRequest.add(new IndexRequest("hotels").id(hotelDoc.getId().toString()).source(JSON.toJSONString(hotelDoc),XContentType.JSON));}// 发送请求client.bulk(bulkRequest,RequestOptions.DEFAULT);}// 解析对象方法public void show(SearchResponse response){// 解析响应SearchHits searchHits = response.getHits();long total = searchHits.getTotalHits().value;System.out.println("总计查询数据:"+total+"条");SearchHit[] hits = searchHits.getHits();for(SearchHit hit :hits){/// 获取文档sourceString json = hit.getSourceAsString();// 反序列化HotelDoc hotelDoc = JSON.parseObject(json, HotelDoc.class);System.out.println("hotelDoc="+hotelDoc);}}/*---------- 全查 ------------*/// 全查@Testvoid findAllDocument() throws IOException{// 准备requestSearchRequest request = new SearchRequest("hotels");// 2.准备DSL,QueryBuilders构造查询条件request.source().query(QueryBuilders.matchAllQuery());// 3.发送请求SearchResponse response = client.search(request, RequestOptions.DEFAULT);show(response);}/*-------------- 全文检索 ---------------*/// 查询all字段内容中含有如家的@Testvoid testMacth() throws IOException{// 准备请求SearchRequest request = new SearchRequest("hotels");// 准备DSLrequest.source().query(QueryBuilders.matchQuery("all","如家"));// 发送请求SearchResponse response = client.search(request, RequestOptions.DEFAULT);show(response);}// 查询字段name、city中有上海的@Testvoid testMultiMatchQuery()throws IOException {// 准备请求SearchRequest request = new SearchRequest("hotels");// 准备DSLrequest.source().query(QueryBuilders.multiMatchQuery("上海","name","city"));// 发送请求SearchResponse response = client.search(request, RequestOptions.DEFAULT);show(response);}/*------------ 精确查询 ------------------*/// term:根据词条精准查询(字段等值查询)@Testvoid testTerm() throws  IOException{// 准备请求SearchRequest request = new SearchRequest("hotels");// 准备DSLrequest.source().query(QueryBuilders.termQuery("brand","希尔顿"));// 发送请求SearchResponse response = client.search(request, RequestOptions.DEFAULT);show(response);}// range范围查询@Testvoid  testRange() throws IOException {// 准备请求SearchRequest request = new SearchRequest("hotels");// 准备DSLrequest.source().query(QueryBuilders.rangeQuery("price").gte(200).lte(300));// 发送请求SearchResponse response = client.search(request, RequestOptions.DEFAULT);show(response);}// ids查询@Testvoid testIds() throws IOException  {// 准备请求SearchRequest request = new SearchRequest("hotels");// 准备DSLrequest.source().query(QueryBuilders.idsQuery().addIds("395434","3532"));// 发送请求SearchResponse response = client.search(request, RequestOptions.DEFAULT);show(response);}/*------------- 复合查询 --------------------*/// bool复合查询@Testvoid testBool() throws IOException{// 准备请求SearchRequest request = new SearchRequest("hotels");// 准备条件/*-- 方式1  ----*///        BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();//        boolQueryBuilder.must(QueryBuilders.termQuery("city","北京"));//        boolQueryBuilder.filter(QueryBuilders.rangeQuery("price").lte(500));//        // 准备DSL//        request.source().query(boolQueryBuilder);/*---- 方式2 ----*/request.source().query(QueryBuilders.boolQuery().must(QueryBuilders.termQuery("city","北京")).filter(QueryBuilders.rangeQuery("price").lte(500)));// 发送请求SearchResponse response = client.search(request, RequestOptions.DEFAULT);show(response);}// 自定义分页方式@Testvoid testPageAndSort() throws IOException{int page = 1;   //页码int size = 5;   //步长String searchName="希尔顿"; // 查询条件// 准备请求SearchRequest request = new SearchRequest("hotels");if (searchName == null){request.source().query(QueryBuilders.matchAllQuery());}else {request.source().query(QueryBuilders.matchQuery("brand",searchName));}// 自定义分页request.source().from((page-1)*size).size(size);// 自定义排序request.source().sort("price", SortOrder.DESC);// 发送请求SearchResponse response = client.search(request, RequestOptions.DEFAULT);// 解析结果show(response);}
}

小结:

文档的查询操作实现步骤大致都相同:

  1. 准备请求
  2. 准备DSL
  3. 发送请求

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/141345.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

基于flask+bootstrap4实现的注重创作的轻博客系统项目源码

一个注重创作的轻博客系统 作为一名技术人员一定要有自己的博客&#xff0c;用来记录平时技术上遇到的问题&#xff0c;把技术分享出去就像滚雪球一样会越來越大&#xff0c;于是我在何三博客的基础上开发了[l4blog]&#xff0c;一个使用python开发的轻量博客系统&#xff0c;…

rabbitMq创建交换机,以及路由键绑定队列教程

创建交换机&#xff1a; 创建队列&#xff1a; 创建路由&#xff0c;绑定到交换机&#xff1a; 补充&#xff1a; 创建新用户后&#xff0c;记得点进用户中&#xff0c;那两个set都点击一下&#xff1b; 还有配置代码连接的时候&#xff0c;连的端口为5672&#xff0c;可不…

基于SSM的校园停车场管理系统

文章目录 项目介绍主要功能截图:部分代码展示设计总结项目获取方式🍅 作者主页:超级无敌暴龙战士塔塔开 🍅 简介:Java领域优质创作者🏆、 简历模板、学习资料、面试题库【关注我,都给你】 🍅文末获取源码联系🍅 项目介绍 基于SSM的校园停车场管理系统,java项目。…

STM32与RTOS的整合:实时操作系统在嵌入式开发中的应用

随着各种嵌入式系统应用的日益复杂和对实时性要求的提高&#xff0c;使用实时操作系统&#xff08;RTOS&#xff09;成为嵌入式开发中的一种重要选择。STM32微控制器作为一种强大的嵌入式处理器&#xff0c;与各种RTOS相结合&#xff0c;能够提供更高效、可靠并且易于维护的系统…

eNSP-打开华为USG6000V1防火墙web管理页面方法

一、本地打开防火墙web管理页面 1.先在ensp中启动USG6000V1防火墙&#xff0c;启动后&#xff0c;需要输入原始username和password&#xff08;username&#xff1a;admin&#xff0c;password&#xff1a;Admin123&#xff09;&#xff0c;并修改原始密码后&#xff0c;才能配…

【中间件篇-Redis缓存数据库08】Redis设计、实现、redisobject对象设计、多线程、缓存淘汰算法

Redis的设计、实现 数据结构和内部编码 type命令实际返回的就是当前键的数据结构类型&#xff0c;它们分别是&#xff1a;string(字符串)hash(哈希)、list(列表)、set(集合)、zset (有序集合)&#xff0c;但这些只是Redis对外的数据结构。 实际上每种数据结构都有自己底层的…

什么是高防IP?

什么是高防IP&#xff1f; 高防IP是针对互联网服务器在遭受大流量的DDOS攻击后导致服务不可用的情况下&#xff0c;推出的付费增值服务&#xff0c;用户可以通过配置高防IP&#xff0c;将攻击流量引流到高防IP&#xff0c;确保源站的稳定可靠。&#xff08;无需转移数据&#…

【Spring Boot】034-Spring Boot 整合 JUnit

【Spring Boot】034-Spring Boot 整合 JUnit 文章目录 【Spring Boot】034-Spring Boot 整合 JUnit一、单元测试1、什么是单元2、什么是单元测试3、为什么要单元测试 二、JUnit1、概述简介特点 2、JUnit4概述基本用法 3、JUnit5概述组成 4、JUnit5 与 JUnit4 的常用注解对比 三…

区间内的真素数问题(C#)

题目&#xff1a;区间内的真素数 找出正整数 M 和 N 之间&#xff08;N 不⼩于 M&#xff09;的所有真素数。真素数的定义&#xff1a;如果⼀个正整数P 为素数&#xff0c;且其反序也为素数&#xff0c;那么 P 就为真素数。例如&#xff0c;11&#xff0c;13 均为真素数&#…

保姆级使用Vue-count-to

安装 npm install vue-count-to 直接使用 <template><div class"vue-count-to"><div class"count-to"><div><CountTo :startValstartVal :endValendVal :durationduration /></div><div><CountTo :startV…

计算机网络期末复习-Part5

1、CRC计算 看例题&#xff1a;待发送序列为101110&#xff0c;生成多项式为X31&#xff0c;计算CRC校验码 先在待发送序列末尾添加与生成多项式次数相同的零&#xff0c;在上述例子中&#xff0c;生成多项式是X^3 1&#xff0c;所以需要添加3个零&#xff0c;待发送序列变成…

一行JavaScrip可以做什么?

说在前面 JavaScript 提供了许多方便的方法和操作符来简化常见的任务&#xff0c;使得编程变得更加高效和便捷。无论是数学计算、字符串处理还是数据操作&#xff0c;JavaScript 都能帮助我们以简洁的方式实现所需功能。 代码 1、生成指定范围内的随机整数 const randomInt …

C_7练习题

一、单项选择题(本大题共20小题,每小题2分,共40分。在每小题给出的四个备选项中,选出一个正确的答案&#xff0c;并将所选项前的字母填写在答题纸的相应位置上。) 1.下列关于C语言的叙述错误的是&#xff08;)。 A.大写字母和小写字母的意义相同 B.不同类型的变量可以在一个表达…

tensorboard报错解决:No dashboards are active for the current data set

版本&#xff1a;tensorboard 2.10.0 问题&#xff1a;文件夹下明明有events文件&#xff0c;但用tensorboard命令却无法显示。 例如&#xff1a; 原因&#xff1a;有可能是文件路径太长了&#xff0c;导致系统无法读取文件。在win系统中规定&#xff0c;目录的绝对路径不得超…

WordPress 文档主题模板Red Line -v0.2.2

此主题作为框架&#xff0c;做承载第三方页面之用&#xff0c;例如飞书文档等&#xff0c; 您可以将视频图片等资源放第三方文档上&#xff0c;通过使用此主题做目录用。 此主题使用前后端分离开发&#xff0c;也使用了一些技术尽量不影响正常的SEO&#xff0c;还望注意。 源码…

线性代数本质系列(一)向量,线性组合,线性相关,矩阵

本系列文章将从下面不同角度解析线性代数的本质&#xff0c;本文是本系列第一篇 向量究竟是什么&#xff1f; 向量的线性组合&#xff0c;基与线性相关 矩阵与线性相关 矩阵乘法与线性变换 三维空间中的线性变换 行列式 逆矩阵&#xff0c;列空间&#xff0c;秩与零空间 克莱姆…

XML Web 服务 Eclipse实现中的sun-jaxws.xml文件

说明 在sun-jaxws.xml文件&#xff0c;可以配置endpoint、handler-chain等内容。在这个文件中配置的内容会覆盖在Java代码中使用注解属性配置的的内容。 这个文件根据自己的项目内容修改完成以后&#xff0c;作为web应用的一部分部署到web容器中&#xff08;放到web应用的WEB…

【机器学习】K近邻算法:原理、实例应用(红酒分类预测)

案例简介&#xff1a;有178个红酒样本&#xff0c;每一款红酒含有13项特征参数&#xff0c;如镁、脯氨酸含量&#xff0c;红酒根据这些特征参数被分成3类。要求是任意输入一组红酒的特征参数&#xff0c;模型需预测出该红酒属于哪一类。 1. K近邻算法介绍 1.1 算法原理 原理&a…

JavaScript从入门到精通系列第三十六篇:详解JavaScript中的事件监听和事件响应

文章目录 一&#xff1a;什么叫事件 1&#xff1a;概念 2&#xff1a;处理这个事件 (一)&#xff1a;鼠标单机按钮 (二)&#xff1a;鼠标双机按钮 (三)&#xff1a;鼠标移动 3&#xff1a;写法弊端 4&#xff1a;Dom Event 二&#xff1a;监听事件 1&#xff1a;元素事…

域名反查Api接口——让您轻松查询域名相关信息

在互联网发展的今天&#xff0c;域名作为网站的唯一标识符&#xff0c;已经成为了企业和个人网络营销中不可或缺的一部分。为了方便用户查询所需的域名信息&#xff0c;API接口应运而生。本文将介绍如何使用挖数据平台《域名反查Api接口——让您轻松查询域名相关信息》进行域名…