Commit 1f91d55b by s_guodong

优化

parent 42065119
......@@ -189,8 +189,11 @@ public class ModelGenerator {
}
// 提取字段长度信息
if (StringUtil.isNotEmpty(len)) {
if (len.contains("[")) {
String s = len.replaceAll("\\[", "").replaceAll("]", "");
if (len.contains(",")) {
String s = len.replaceAll("\\[", "")
.replaceAll("]", "")
.replaceAll("\\(", "")
.replaceAll("\\)", "");
String[] split = s.split(",");
((Set) field.get("fieldannotation")).add("@Len(min = " + Integer.valueOf(split[0]) + ",max =" + Integer.valueOf(split[1]) + " )");
} 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