Commit 1f91d55b by s_guodong

优化

parent 42065119
...@@ -189,8 +189,11 @@ public class ModelGenerator { ...@@ -189,8 +189,11 @@ public class ModelGenerator {
} }
// 提取字段长度信息 // 提取字段长度信息
if (StringUtil.isNotEmpty(len)) { if (StringUtil.isNotEmpty(len)) {
if (len.contains("[")) { if (len.contains(",")) {
String s = len.replaceAll("\\[", "").replaceAll("]", ""); String s = len.replaceAll("\\[", "")
.replaceAll("]", "")
.replaceAll("\\(", "")
.replaceAll("\\)", "");
String[] split = s.split(","); String[] split = s.split(",");
((Set) field.get("fieldannotation")).add("@Len(min = " + Integer.valueOf(split[0]) + ",max =" + Integer.valueOf(split[1]) + " )"); ((Set) field.get("fieldannotation")).add("@Len(min = " + Integer.valueOf(split[0]) + ",max =" + Integer.valueOf(split[1]) + " )");
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment