log日志记录
This commit is contained in:
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
@ -11,8 +12,10 @@ import java.net.URL;
|
||||
public class IpDemo {
|
||||
|
||||
public static void main(String[] args) {
|
||||
getIpLocation("123.167.57.119");
|
||||
getIpLocation("42.100.248.19");
|
||||
}
|
||||
|
||||
|
||||
public static String getIpLocation(String ip) {
|
||||
try {
|
||||
// 发送请求到ip-api服务
|
||||
@ -36,8 +39,8 @@ public class IpDemo {
|
||||
String region = jsonResponse.getString("regionName"); // 省
|
||||
String city = jsonResponse.getString("city"); // 城市
|
||||
System.out.println(jsonResponse);
|
||||
System.out.println(country + "-" + region + "省" + "-" + city);
|
||||
return country + "-" + region + "省" + "-" + city; // 返回位置
|
||||
System.out.println(country + "-" + region + "-" + city);
|
||||
return country + "-" + region + "-" + city; // 返回位置
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -45,4 +48,6 @@ public class IpDemo {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
37
src/test/java/com/greenorange/promotion/draft/DraftList.java
Normal file
37
src/test/java/com/greenorange/promotion/draft/DraftList.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.greenorange.promotion.draft;
|
||||
|
||||
public class DraftList {
|
||||
|
||||
// /**
|
||||
// * web端管理员根据id查询用户表
|
||||
// * @param id 用户表查询请求体
|
||||
// * @return 用户表信息
|
||||
// */
|
||||
// @GetMapping("queryById")
|
||||
// @Operation(summary = "web端管理员根据id查询用户", description = "参数:用户表查询请求体,权限:管理员(boss, admin),方法名:queryUserInfoById")
|
||||
//// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
// public BaseResponse<UserInfoVO> queryUserInfoByGetId(@RequestParam Long id) {
|
||||
// UserInfo userInfo = userInfoService.getById(id);
|
||||
// ThrowUtils.throwIf(userInfo == null, ErrorCode.OPERATION_ERROR, "当前用户不存在");
|
||||
// UserInfoVO userInfoVO = commonService.copyProperties(userInfo, UserInfoVO.class);
|
||||
// return ResultUtils.success(userInfoVO);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * web端管理员根据id查询用户表
|
||||
// * @param id 用户表查询请求体
|
||||
// * @return 用户表信息
|
||||
// */
|
||||
// @GetMapping("queryById/{id}")
|
||||
// @Operation(summary = "web端管理员根据id查询用户", description = "参数:用户表查询请求体,权限:管理员(boss, admin),方法名:queryUserInfoById")
|
||||
//// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
// public BaseResponse<UserInfoVO> queryUserInfoByPathId(@PathVariable Long id) {
|
||||
// UserInfo userInfo = userInfoService.getById(id);
|
||||
// ThrowUtils.throwIf(userInfo == null, ErrorCode.OPERATION_ERROR, "当前用户不存在");
|
||||
// UserInfoVO userInfoVO = commonService.copyProperties(userInfo, UserInfoVO.class);
|
||||
// return ResultUtils.success(userInfoVO);
|
||||
// }
|
||||
|
||||
}
|
Reference in New Issue
Block a user