根据ip获取对应城市
# blzo-ex-ip2region 根据ip获取对应城市
封装了 由狮子的魂开发的ip2region
在blzo中引入即可直接获得 ip定位城市的能力
# 引入
gradle
// https://mvnrepository.com/artifact/com.jdkhome.blzo/blzo-ex-ip2region
compile group: 'com.jdkhome.blzo', name: 'blzo-ex-ip2region', version: 0.3.0.1.RELEASE
1
2
2
maven
<!-- https://mvnrepository.com/artifact/com.jdkhome.blzo/blzo-ex-ip2region -->
<dependency>
<groupId>com.jdkhome.blzo</groupId>
<artifactId>blzo-ex-ip2region</artifactId>
<version>0.3.0.1.RELEASE</version>
</dependency>
1
2
3
4
5
6
2
3
4
5
6
# 使用
String city = IpRegionTools.getCity(IpTools.getIp(request));
1
上次更新: 2020/06/11, 18:06:00