From 1dc525a89404e4ea725bf6397fd35813209a9e46 Mon Sep 17 00:00:00 2001 From: zxm <154040976@qq.com> Date: Sun, 28 Jan 2018 00:14:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dfreemarker=20=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/len/util/Md5Util.java | 2 +- .../src/main/java/com/len/util/ReType.java | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/len-core/src/main/java/com/len/util/Md5Util.java b/len-core/src/main/java/com/len/util/Md5Util.java index 51f746a..3a1a459 100644 --- a/len-core/src/main/java/com/len/util/Md5Util.java +++ b/len-core/src/main/java/com/len/util/Md5Util.java @@ -18,7 +18,7 @@ public class Md5Util { * @param args */ public static void main(String[] args) { - String str= getMD5("123456","ceship"); + String str= getMD5("123456","tom"); System.out.println(str); } } diff --git a/len-core/src/main/java/com/len/util/ReType.java b/len-core/src/main/java/com/len/util/ReType.java index c8a9e65..e0a6c24 100644 --- a/len-core/src/main/java/com/len/util/ReType.java +++ b/len-core/src/main/java/com/len/util/ReType.java @@ -1,7 +1,11 @@ package com.len.util; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import java.io.Serializable; import java.util.List; +import java.util.Map; /** * @author zhuxiaomeng @@ -26,4 +30,26 @@ public class ReType implements Serializable{ this.count = count; this.data = data; } + + /** + * 动态添加属性 map 用法可以参考 activiti 模块中 com.len.JsonTest 测试类中用法 + * @param count + * @param data + * @param map + * @param node 绑定节点字符串 这样可以更加灵活 + * @return + */ + public static String jsonStrng(long count,List data,Map> map,String node){ + JSONArray jsonArray=JSONArray.parseArray(JSON.toJSONString(data)); + JSONObject object=new JSONObject(); + for(int i=0;i