update 增加多个方法的注释以提升代码可读性

This commit is contained in:
AprilWind
2026-05-15 13:04:30 +08:00
parent 592d998e0f
commit 4fdf2ea75a
25 changed files with 514 additions and 6 deletions
@@ -135,6 +135,12 @@ public enum FormatsType {
*/
private final String timeFormat;
/**
* 根据字符串内容匹配时间格式类型。
*
* @param str 字符串内容
* @return 时间格式类型
*/
public static FormatsType getFormatsType(String str) {
for (FormatsType value : values()) {
if (StringUtils.contains(str, value.getTimeFormat())) {
@@ -60,6 +60,11 @@ public final class SpringUtils extends SpringUtil {
return getApplicationContext();
}
/**
* 当前是否启用虚拟线程。
*
* @return true 启用 false 未启用
*/
public static boolean isVirtual() {
return Threading.VIRTUAL.isActive(getBean(Environment.class));
}
@@ -21,6 +21,12 @@ public class AddressUtils {
// 内网地址
public static final String LOCAL_ADDRESS = "内网IP";
/**
* 根据 IP 查询真实地址。
*
* @param ip IP 地址
* @return 真实地址
*/
public static String getRealAddressByIP(String ip) {
// 处理空串并过滤HTML标签
ip = HtmlUtil.cleanHtmlTag(StringUtils.blankToDefault(ip,""));