update 增加多个方法的注释以提升代码可读性
This commit is contained in:
+6
@@ -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())) {
|
||||
|
||||
+5
@@ -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));
|
||||
}
|
||||
|
||||
+6
@@ -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,""));
|
||||
|
||||
Reference in New Issue
Block a user