From 8812516d440c38ee4691daeb2e1685d1eabe85dd Mon Sep 17 00:00:00 2001 From: fhx <308050795@qq.com> Date: 星期一, 06 十一月 2023 18:31:41 +0800 Subject: [PATCH] 1.修改扫描位置 --- src/main/java/com/hx/resultTool/Result.java | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/hx/resultTool/Result.java b/src/main/java/com/hx/resultTool/Result.java index 4cc8121..5c696b0 100644 --- a/src/main/java/com/hx/resultTool/Result.java +++ b/src/main/java/com/hx/resultTool/Result.java @@ -6,6 +6,7 @@ import com.hx.exception.TipsException; import java.io.Serializable; +import java.util.List; /** * 缁熶竴杩斿洖鏍煎紡 @@ -84,10 +85,16 @@ return JSONArray.parseArray(JSON.toJSONString(data)); } + /**杩斿洖鏁版嵁杞璞�*/ public <T> T getObject(Object data, Class<T> clazz) { return JSONObject.parseObject(JSON.toJSONString(data), clazz); } + /**杩斿洖鏁版嵁杞垪琛�*/ + public <T> List<T> getArray(Object data, Class<T> clazz) { + return JSONArray.parseArray(JSON.toJSONString(data), clazz); + } + /*******************************************************************************/ public String getCode() { -- Gitblit v1.8.0