Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybatisplus-inverse_swagger
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
fxkc_tools
mybatisplus-inverse_swagger
Commits
106fb729
Commit
106fb729
authored
Apr 21, 2022
by
xiemouren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加DeleteGenerateFiles工具类
parent
47a1954e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
2 deletions
+40
-2
src/main/java/CodeGenerator.java
src/main/java/CodeGenerator.java
+1
-2
src/main/java/DeleteGenerateFiles.java
src/main/java/DeleteGenerateFiles.java
+39
-0
No files found.
src/main/java/CodeGenerator.java
View file @
106fb729
...
...
@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Properties
;
class
CodeGenerator
{
public
static
void
main
(
String
[]
args
)
{
...
...
@@ -71,7 +70,7 @@ class CodeGenerator {
@Override
public
String
outputFile
(
TableInfo
tableInfo
)
{
//TODO 改动
// return projectPath + "/src/main/resources/mapper/" + pc.getModuleName() + "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
// return projectPath + "/src/main/resources/mapper/" + pc.getModuleName() + "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
return
projectPath
+
"/src/main/resources/mapper/"
+
tableInfo
.
getEntityName
()
+
"Mapper"
+
StringPool
.
DOT_XML
;
}
});
...
...
src/main/java/DeleteGenerateFiles.java
0 → 100644
View file @
106fb729
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
/**
* 删除生成的文件
* Created by XGL on 2022/4/21
*/
public
class
DeleteGenerateFiles
{
public
static
void
main
(
String
[]
args
)
{
String
projectPath
=
System
.
getProperty
(
"user.dir"
);
String
path1
=
projectPath
+
"/src/main/java/com"
;
String
path2
=
projectPath
+
"/src/main/resources/mapper"
;
List
<
String
>
pathList
=
new
ArrayList
<>(
Arrays
.
asList
(
path1
,
path2
));
for
(
String
path
:
pathList
)
{
boolean
result
=
deleteDir
(
new
File
(
path
));
if
(
result
)
{
System
.
out
.
println
(
path
+
"路径下的文件批量删除成功!"
);
}
else
{
System
.
out
.
println
(
path
+
"路径下的文件批量删除失败!"
);
}
}
}
public
static
boolean
deleteDir
(
File
dir
)
{
if
(
dir
.
isDirectory
())
{
String
[]
children
=
dir
.
list
();
for
(
int
i
=
0
;
i
<
children
.
length
;
i
++)
{
boolean
success
=
deleteDir
(
new
File
(
dir
,
children
[
i
]));
if
(!
success
)
{
return
false
;
}
}
}
return
dir
.
delete
();
}
}
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