!856 update 优化代码,简化类型检查

* update 优化代码,简化类型检查
This commit is contained in:
AprilWind
2026-06-10 06:38:46 +00:00
committed by 疯狂的狮子Li
parent fc43e368b7
commit 0b37392a8f
12 changed files with 44 additions and 29 deletions
@@ -60,7 +60,7 @@ public record HandleAsyncResult<T>(
* @return 异步处理结果
*/
public static <T> HandleAsyncResult<T> of(T result, Throwable error) {
return new HandleAsyncResult<T>(result, error);
return new HandleAsyncResult<>(result, error);
}
/**
@@ -71,7 +71,7 @@ public record HandleAsyncResult<T>(
* @return 异步处理结果
*/
public static <T> HandleAsyncResult<T> success(T result) {
return new HandleAsyncResult<T>(result, null);
return new HandleAsyncResult<>(result, null);
}
/**
@@ -82,6 +82,6 @@ public record HandleAsyncResult<T>(
* @return 异步处理结果
*/
public static <T> HandleAsyncResult<T> failure(Throwable error) {
return new HandleAsyncResult<T>(null, error);
return new HandleAsyncResult<>(null, error);
}
}