Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fgqyxxlr
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yaru
fgqyxxlr
Commits
362374d0
Commit
362374d0
authored
Sep 11, 2019
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码生成表前缀配置支持多个
parent
c6c71a7e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java
+20
-1
ruoyi-generator/src/main/resources/generator.yml
+2
-1
No files found.
ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java
View file @
362374d0
...
...
@@ -164,7 +164,9 @@ public class GenUtils
String
tablePrefix
=
GenConfig
.
getTablePrefix
();
if
(
autoRemovePre
&&
StringUtils
.
isNotEmpty
(
tablePrefix
))
{
tableName
=
tableName
.
replaceFirst
(
tablePrefix
,
""
);
String
[]
searchList
=
StringUtils
.
split
(
tablePrefix
,
","
);
String
[]
replacementList
=
emptyList
(
searchList
.
length
);
tableName
=
StringUtils
.
replaceEach
(
tableName
,
searchList
,
replacementList
);
}
return
StringUtils
.
convertToCamelCase
(
tableName
);
}
...
...
@@ -216,4 +218,20 @@ public class GenUtils
return
0
;
}
}
/**
* 获取空数组列表
*
* @param length 长度
* @return 数组信息
*/
public
static
String
[]
emptyList
(
int
length
)
{
String
[]
values
=
new
String
[
length
];
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
values
[
i
]
=
StringUtils
.
EMPTY
;
}
return
values
;
}
}
\ No newline at end of file
ruoyi-generator/src/main/resources/generator.yml
View file @
362374d0
...
...
@@ -7,5 +7,5 @@ gen:
packageName
:
com.ruoyi.system
# 自动去除表前缀,默认是false
autoRemovePre
:
false
# 表前缀
(类名不会包含表前缀)
# 表前缀
(生成类名不会包含表前缀,多个用逗号分隔)
tablePrefix
:
sys_
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment