iptool

ip locating agent tool

Лицензия

Лицензия

Группа

Группа

com.github.blankhang
Идентификатор

Идентификатор

iptool
Последняя версия

Последняя версия

1.1.0
Дата

Дата

Тип

Тип

pom
Описание

Описание

iptool
ip locating agent tool
Ссылка на сайт

Ссылка на сайт

https://github.com/blankhang/iptool
Система контроля версий

Система контроля версий

https://github.com/blankhang/iptool

Скачать iptool

Имя Файла Размер
iptool-1.1.0.pom 11 KB
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.blankhang/iptool/ -->
<dependency>
    <groupId>com.github.blankhang</groupId>
    <artifactId>iptool</artifactId>
    <version>1.1.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.blankhang/iptool/
implementation 'com.github.blankhang:iptool:1.1.0'
// https://jarcasting.com/artifacts/com.github.blankhang/iptool/
implementation ("com.github.blankhang:iptool:1.1.0")
'com.github.blankhang:iptool:pom:1.1.0'
<dependency org="com.github.blankhang" name="iptool" rev="1.1.0">
  <artifact name="iptool" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.github.blankhang', module='iptool', version='1.1.0')
)
libraryDependencies += "com.github.blankhang" % "iptool" % "1.1.0"
[com.github.blankhang/iptool "1.1.0"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

  • common

iptool

ip locating agent tool ip 定位辅助工具

This work is licensed under

  1. Creative Commons Attribution-ShareAlike 4.0 International License
  2. GeoLite2 End User License Agreement
  3. This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com

how to use 用法

add 添加 maven 依赖

  <dependency>
    <groupId>com.github.blankhang</groupId>
    <artifactId>common</artifactId>
    <version>1.1.0</version>
  </dependency>

this dependency to your pom.xml
then just like this 然后就像这样
support both English and Chinese 支持返回中英文国家/省/州/市名

    // the 1st param support both HttpServletRequest or ip String , the 2nd param support zh-CN(equals to null) or en
    // 第一参数支持 HttpServletRequest 或 字符串的ip ,第二参数为 支持语言 目前支持中文或英文 给null 的话默认返回中文
    String countryName = IpUtil.getCountryName("183.22.183.2", null);
    // or  String countryName = IpUtil.getCountryName("183.22.183.2", "zh-CN");
    //中国
    System.out.println(countryName);
    countryName = IpUtil.getCountryName("183.22.183.2", "en");
    //China
    System.out.println(countryName);

    String stateName = IpUtil.getStateName("183.22.183.2", null);
    // or String stateName = IpUtil.getStateName("183.22.183.2", "zh-CN");
    //广东
    System.out.println(stateName);
    stateName = IpUtil.getStateName("183.22.183.2", "en");
    //Guangdong
    System.out.println(stateName);

    //Guangdong
    String cityName = IpUtil.getCityName("183.22.183.2", null);
    // or String cityName = IpUtil.getCityName("183.22.183.2", "zh-CN");
    //东莞市
    System.out.println(cityName);
    cityName = IpUtil.getCityName("183.22.183.2", "en");
    //Dongguan
    System.out.println(cityName);

Версии библиотеки

Версия
1.1.0
1.0.9
1.0.5
1.0.1
1.0.0