|
|
|
@ -14,8 +14,9 @@ public class IPController {
|
|
|
|
|
private LookupService lookupService;
|
|
|
|
|
|
|
|
|
|
@GetMapping("/{ipAddr}")
|
|
|
|
|
public String getIpInfo(@PathVariable String ipAddr) {
|
|
|
|
|
String city = lookupService.getLocation(ipAddr).city;
|
|
|
|
|
return city;
|
|
|
|
|
public JSONObject getIpInfo(@PathVariable String ipAddr) {
|
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
|
|
result.put("city", lookupService.getLocation(ipAddr).city);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|