05 2024 档案
摘要:实现RuntimeHintsRegistrar接口,再用hints添加要注册的类型。 eg: @Configuration @ImportRuntimeHints(MyRuntimeHintsRegistrar.class) public class MyRuntimeHintsRegistrar
阅读全文
摘要:枚举脱敏字段类型及规则 import java.util.function.Function; public enum TextMaskStrategy { ID_NO("身份证", 18, text -> "*".repeat(text.length() - 4) + text.substring
阅读全文
摘要:原因:输出的字符集与源文件字符集不一致 如果源文件为UTF-8 先运行字符集修改命令 chcp 65001 再执行既有命令 2、如果源文件为GB2312/GBK 先运行字符集修改命令 chcp 936 再执行命令 3、如果源文件为BIG5 先运行字符集修改命令 chcp 950 再执行命令 拓展:c
阅读全文
摘要:httpServer.createContext("/abc", SimpleFileServer.createFileHandler(Path.of("D:\\my-abc"))); httpServer.createContext("/def", SimpleFileServer.createF
阅读全文
摘要:方法:重写MessageConverter, 使得yyyy-MM-dd HH:mm:ss的字符串能反序列化到LocalDateTime类型上。 @Configuration public class HttpClientConfig { @Value("${service.host}") priva
阅读全文