All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.dengchen2020.ip.model.IpInfo Maven / Gradle / Ivy

There is a newer version: 0.0.30
Show newest version
package io.github.dengchen2020.ip.model;

import io.github.dengchen2020.core.utils.JsonUtils;
import org.springframework.util.StringUtils;

/**
 * ip信息
 * @author dengchen
 * @since 2023/5/6
 */
public class IpInfo {

    public IpInfo() {}

    public IpInfo(String ip) {
        this.ip = ip;
    }

    /**
     * ip
     */
    private String ip;

    /**
     * 洲
     */
    private String continent;

    /**
     * 国家
     */
    private String country;

    /**
     * 省份
     */
    private String province;

    /**
     * 城市
     */
    private String city;

    /**
     * 地区
     */
    private String district;

    /**
     * 互联网服务提供商
     */
    private String isp;

    /**
     * 行政区划代码1
     */
    private String zoningCode1;

    /**
     * 行政区划代码2
     */
    private String zoningCode2;

    /**
     * 行政区划代码3
     */
    private String zoningCode3;

    /**
     * 国家英文
     */
    private String nationalEnglish;

    /**
     * 国家英文缩写
     */
    private String countryAbbreviations;

    /**
     * 国际区号
     */
    private String internationalAreaCode;

    /**
     * 经度
     */
    private String longitude;

    /**
     * 纬度
     */
    private String latitude;

    public String getIp() {
        return ip;
    }

    public IpInfo setIp(String ip) {
        this.ip = ip;
        return this;
    }

    public String getContinent() {
        return continent;
    }

    public IpInfo setContinent(String continent) {
        this.continent = continent;
        return this;
    }

    public String getCountry() {
        return country;
    }

    public IpInfo setCountry(String country) {
        this.country = country;
        return this;
    }

    public String getProvince() {
        return province;
    }

    public IpInfo setProvince(String province) {
        this.province = province;
        return this;
    }

    public String getCity() {
        return city;
    }

    public IpInfo setCity(String city) {
        this.city = city;
        return this;
    }

    public String getDistrict() {
        return district;
    }

    public IpInfo setDistrict(String district) {
        this.district = district;
        return this;
    }

    public String getIsp() {
        return isp;
    }

    public IpInfo setIsp(String isp) {
        this.isp = isp;
        return this;
    }

    public String getZoningCode1() {
        return zoningCode1;
    }

    public IpInfo setZoningCode1(String zoningCode1) {
        this.zoningCode1 = zoningCode1;
        return this;
    }

    public String getZoningCode2() {
        return zoningCode2;
    }

    public IpInfo setZoningCode2(String zoningCode2) {
        this.zoningCode2 = zoningCode2;
        return this;
    }

    public String getZoningCode3() {
        return zoningCode3;
    }

    public IpInfo setZoningCode3(String zoningCode3) {
        this.zoningCode3 = zoningCode3;
        return this;
    }

    public String getNationalEnglish() {
        return nationalEnglish;
    }

    public IpInfo setNationalEnglish(String nationalEnglish) {
        this.nationalEnglish = nationalEnglish;
        return this;
    }

    public String getCountryAbbreviations() {
        return countryAbbreviations;
    }

    public IpInfo setCountryAbbreviations(String countryAbbreviations) {
        this.countryAbbreviations = countryAbbreviations;
        return this;
    }

    public String getInternationalAreaCode() {
        return internationalAreaCode;
    }

    public IpInfo setInternationalAreaCode(String internationalAreaCode) {
        this.internationalAreaCode = internationalAreaCode;
        return this;
    }

    public String getLongitude() {
        return longitude;
    }

    public IpInfo setLongitude(String longitude) {
        this.longitude = longitude;
        return this;
    }

    public String getLatitude() {
        return latitude;
    }

    public IpInfo setLatitude(String latitude) {
        this.latitude = latitude;
        return this;
    }

    @Override
    public String toString() {
        if(!StringUtils.hasText(ip)){
            return "{}";
        }
        return JsonUtils.toJson(this);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy