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
a42c824e
Commit
a42c824e
authored
Nov 22, 2018
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文件路径保持与packageName一致
parent
67e87bde
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java
+12
-9
No files found.
ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java
View file @
a42c824e
...
...
@@ -20,7 +20,7 @@ import com.ruoyi.generator.domain.TableInfo;
public
class
GenUtils
{
/** 项目空间路径 */
private
static
final
String
PROJECT_PATH
=
"main/java/com/ruoyi"
;
private
static
final
String
PROJECT_PATH
=
getProjectPath
()
;
/** mybatis空间路径 */
private
static
final
String
MYBATIS_PATH
=
"main/resources/mapper"
;
...
...
@@ -124,7 +124,7 @@ public class GenUtils
String
classname
=
table
.
getClassname
();
// 大写类名
String
className
=
table
.
getClassName
();
String
javaPath
=
PROJECT_PATH
+
"/"
+
moduleName
+
"/"
;
String
javaPath
=
PROJECT_PATH
;
String
mybatisPath
=
MYBATIS_PATH
+
"/"
+
moduleName
+
"/"
+
className
;
String
htmlPath
=
TEMPLATES_PATH
+
"/"
+
moduleName
+
"/"
+
classname
;
...
...
@@ -198,6 +198,16 @@ public class GenUtils
return
basePackage
;
}
public
static
String
getProjectPath
()
{
String
packageName
=
Global
.
getPackageName
();
StringBuffer
projectPath
=
new
StringBuffer
();
projectPath
.
append
(
"main/java/"
);
projectPath
.
append
(
packageName
.
replace
(
"."
,
"/"
));
projectPath
.
append
(
"/"
);
return
projectPath
.
toString
();
}
public
static
String
replaceKeyword
(
String
keyword
)
{
String
keyName
=
keyword
.
replaceAll
(
"(?:表|信息)"
,
""
);
...
...
@@ -227,11 +237,4 @@ public class GenUtils
javaTypeMap
.
put
(
"datetime"
,
"Date"
);
javaTypeMap
.
put
(
"timestamp"
,
"Date"
);
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
StringUtils
.
convertToCamelCase
(
"user_name"
));
System
.
out
.
println
(
replaceKeyword
(
"岗位信息表"
));
System
.
out
.
println
(
getBasePackage
(
"com.ruoyi.system"
));
}
}
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