parent
b0b4584e63
commit
7cdc44424f
@ -0,0 +1,30 @@ |
||||
package com.hai.common.utils; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
|
||||
/** |
||||
* 百度工具 |
||||
* @className: BaiduUtis |
||||
* @author: HuRui |
||||
* @date: 2022/10/21 |
||||
**/ |
||||
public class BaiduUtils { |
||||
|
||||
private static Logger log = LoggerFactory.getLogger(BaiduUtils.class); |
||||
|
||||
/** |
||||
* IP 定位 |
||||
* @param ip ip地址 |
||||
* @return |
||||
*/ |
||||
public static JSONObject ipLocation(String ip) { |
||||
JSONObject response = HttpsUtils.doGet("https://api.map.baidu.com/location/ip?ak=X4sSdXsohVOMb1tNiLZloD9ows5FaNjq&ip=" + ip); |
||||
log.info(response.toJSONString()); |
||||
return response; |
||||
} |
||||
|
||||
|
||||
} |
Loading…
Reference in new issue