[*] 十年饮冰 难凉热血

This commit is contained in:
acgist
2023-03-10 23:35:24 +08:00
parent 63a37be492
commit 1bf8fbe415
57 changed files with 1593 additions and 393 deletions

View File

@@ -11,10 +11,6 @@ public interface Constant {
* 接收方的终端标识
*/
String TO = "to";
/**
* 换行
*/
String LINE = "\n";
/**
* IP
*/

View File

@@ -17,12 +17,42 @@ import lombok.Setter;
@ConfigurationProperties(prefix = "taoyao.socket")
public class SocketProperties {
/**
* 机密策略
*
* @author acgist
*/
@Getter
public enum Encrypt {
// AES
AES("AES/ECB/PKCS5Padding"),
// DES
DES("DES/ECB/PKCS5Padding"),
// 明文
PLAINTEXT(null);
/**
* 算法
*/
private final String algo;
private Encrypt(String algo) {
this.algo = algo;
}
}
@Schema(title = "是否启用", description = "是否启用")
private Boolean enabled;
@Schema(title = "监听地址", description = "监听地址")
private String host;
@Schema(title = "监听端口", description = "监听端口")
private Integer port;
@Schema(title = "加密策略", description = "加密策略")
private Encrypt encrypt;
@Schema(title = "加密密钥", description = "加密密钥:为空自动生成")
private String encryptKey;
@Schema(title = "超时时间", description = "超时时间")
private Long timeout;
@Schema(title = "队列长度", description = "队列长度")
@@ -37,5 +67,7 @@ public class SocketProperties {
private Long keepAliveTime;
@Schema(title = "缓冲大小", description = "缓冲大小")
private Integer bufferSize;
@Schema(title = "最大缓冲大小", description = "最大缓冲大小")
private Integer maxBufferSize;
}

View File

@@ -32,7 +32,9 @@ public class WebMvcConfigurerAutoConfiguration implements WebMvcConfigurer {
.sorted((a, z) -> a.getValue().compareTo(z.getValue()))
.forEach(entry -> {
final InterceptorAdapter value = entry.getValue();
log.info("注册MVC拦截器{} - {}", String.format("%-32s", entry.getKey()), value.name());
if(log.isDebugEnabled()) {
log.debug("注册MVC拦截器{} - {}", String.format("%-32s", entry.getKey()), value.name());
}
registry.addInterceptor(value).addPathPatterns(value.pathPattern());
});
}