添加操作日志服务.

This commit is contained in:
lijiahang
2023-10-10 16:56:56 +08:00
parent a1477e9614
commit 730fb000d1
18 changed files with 739 additions and 16 deletions

View File

@@ -41,6 +41,8 @@ public interface AutoConfigureOrderConst {
int FRAMEWORK_MONITOR = Integer.MIN_VALUE + 2200;
int FRAMEWORK_BANNER = Integer.MIN_VALUE + 2300;
int FRAMEWORK_BIZ_OPERATOR_LOG = Integer.MIN_VALUE + 3000;
int FRAMEWORK_BANNER = Integer.MIN_VALUE + 10000;
}

View File

@@ -4,13 +4,20 @@ import com.orion.ext.location.Region;
import com.orion.ext.location.region.LocationRegions;
import com.orion.ops.framework.common.constant.Const;
import java.util.HashMap;
import java.util.Map;
/**
* ip 工具类
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/7/14 16:26
*/
public class IpUtils {
private static final Map<String, String> CACHE = new HashMap<>();
private IpUtils() {
}
@@ -21,6 +28,20 @@ public class IpUtils {
* @return ip 位置
*/
public static String getLocation(String ip) {
if (ip == null) {
return Const.UNKNOWN;
}
// 查询缓存
return CACHE.computeIfAbsent(ip, IpUtils::queryLocation);
}
/**
* 查询 ip 位置
*
* @param ip ip
* @return ip 位置
*/
private static String queryLocation(String ip) {
if (ip == null) {
return Const.UNKNOWN;
}