From 6b479c5774ed3d6e2dc92693ddeda3e7ad1494db Mon Sep 17 00:00:00 2001 From: Andru <769883346@qq.com> Date: 星期一, 23 十月 2023 17:34:08 +0800 Subject: [PATCH] 添加获客方法 --- src/main/java/com/hx/resultTool/Result.java | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/hx/resultTool/Result.java b/src/main/java/com/hx/resultTool/Result.java index 698438a..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,6 +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