File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
tang-generator/src/main/java/com/tang/generator/utils Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 1
1
package com .tang .generator .utils ;
2
2
3
3
import java .io .StringWriter ;
4
- import java .util .ArrayList ;
5
4
import java .util .List ;
5
+ import java .util .stream .Collectors ;
6
6
import java .util .stream .Stream ;
7
7
8
8
import org .apache .commons .lang3 .StringUtils ;
@@ -148,13 +148,11 @@ private static String getDictTypeVar(GenTable table) {
148
148
* @return 字典集合
149
149
*/
150
150
private static List <String > getDictTypeList (GenTable table ) {
151
- var dictTypeList = new ArrayList <String >();
152
- for (GenTableColumn tableColumn : table .getTableColumnList ()) {
153
- if (StringUtils .isNotBlank (tableColumn .getDictType ())) {
154
- dictTypeList .add (tableColumn .getDictType ());
155
- }
156
- }
157
- return dictTypeList ;
151
+ return table .getTableColumnList ().stream ()
152
+ .map (GenTableColumn ::getDictType )
153
+ .filter (StringUtils ::isNotBlank )
154
+ .distinct ()
155
+ .collect (Collectors .toList ());
158
156
}
159
157
160
158
/**
You can’t perform that action at this time.
0 commit comments