refactor: 修改 framework 逻辑.
This commit is contained in:
@@ -3,7 +3,7 @@ package com.orion.ops.framework.common.entity;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 请求留痕
|
||||
* 请求留痕信息
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
@@ -11,6 +11,27 @@ import java.io.Serializable;
|
||||
*/
|
||||
public interface RequestIdentity extends Serializable {
|
||||
|
||||
/**
|
||||
* 获取请求地址
|
||||
*
|
||||
* @return address
|
||||
*/
|
||||
String getAddress();
|
||||
|
||||
/**
|
||||
* 获取请求位置
|
||||
*
|
||||
* @return location
|
||||
*/
|
||||
String getLocation();
|
||||
|
||||
/**
|
||||
* 获取请求 userAgent
|
||||
*
|
||||
* @return userAgent
|
||||
*/
|
||||
String getUserAgent();
|
||||
|
||||
/**
|
||||
* 设置请求地址
|
||||
*
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.orion.ops.framework.common.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 请求留痕模型
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/12/29 11:57
|
||||
*/
|
||||
@Data
|
||||
public class RequestIdentityModel implements RequestIdentity {
|
||||
|
||||
/**
|
||||
* 请求地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 请求位置
|
||||
*/
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* userAgent
|
||||
*/
|
||||
private String userAgent;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.orion.ops.framework.common.utils;
|
||||
|
||||
import com.orion.lang.utils.Exceptions;
|
||||
import com.orion.ops.framework.common.crypto.ValueCrypto;
|
||||
|
||||
/**
|
||||
@@ -141,6 +142,10 @@ public class CryptoUtils {
|
||||
}
|
||||
|
||||
public static void setDelegate(ValueCrypto delegate) {
|
||||
if (CryptoUtils.delegate != null) {
|
||||
// unmodified
|
||||
throw Exceptions.state();
|
||||
}
|
||||
CryptoUtils.delegate = delegate;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.orion.ops.framework.common.utils;
|
||||
|
||||
import com.orion.lang.utils.Exceptions;
|
||||
import com.orion.ops.framework.common.file.FileClient;
|
||||
|
||||
import java.io.InputStream;
|
||||
@@ -130,6 +131,10 @@ public class FileClientUtils {
|
||||
}
|
||||
|
||||
public static void setDelegate(FileClient delegate) {
|
||||
if (FileClientUtils.delegate != null) {
|
||||
// unmodified
|
||||
throw Exceptions.state();
|
||||
}
|
||||
FileClientUtils.delegate = delegate;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user