# eaglemap-spring-boot-starter
**Repository Path**: dingjunjun_codeSpace/eaglemap-spring-boot-starter
## Basic Information
- **Project Name**: eaglemap-spring-boot-starter
- **Description**: 实现EagleMap-sdk与SpringBoot的快速整合。
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 8
- **Created**: 2023-03-25
- **Last Updated**: 2023-03-25
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# 关于eaglemap-spring-boot-starter
eaglemap-spring-boot-starter是基于EagleMap-sdk完成与SpringBoot的整合。
EagleMap-sdk源码地址:
https://gitee.com/itcastopen/EagleMap-sdk.git
https://github.com/itcastopen/EagleMap-sdk.git
# 版本说明
> 建议使用稳定版。
| 项目 | 最新稳定版 | 发布时间 |
| ---------------------------- | ---------- | ---------- |
| EagleMap-sdk | 1.0 | 2022-03-31 |
| eaglemap-spring-boot-starter | 1.0 | 2022-03-31 |
目前最新快照版为:1.1-SNAPSHOT
# 快速使用
> **第一步,导入maven依赖**
~~~xml
com.itheima.em
eaglemap-spring-boot-starter
{version}
sonatypeSnapshots
Sonatype Snapshots
false
true
https://s01.oss.sonatype.org/content/repositories/snapshots/
~~~
> **第二步,配置application.yml文件**
~~~yml
eagle:
host: 127.0.0.1 #EagleMap服务地址
port: 8484 #EagleMap服务端口
timeout: 10000 #http请求的超时时间
~~~
**第三步,测试用例**
~~~java
package cn.itcast.em.boot;
import EagleMapTemplate;
import IpResult;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@SpringBootTest
@RunWith(SpringRunner.class)
public class EagleMapTest {
@Autowired //自动注入
private EagleMapTemplate eagleMapTemplate;
@Test
public void queryIp() {
String ip = "114.242.26.45";
//根据ip地址查询对应的地区、经纬度坐标等信息
IpResult ipResult = this.eagleMapTemplate.opsForBase().queryIp(ip);
System.out.println(ipResult);
}
}
~~~