Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-demo-base
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
gic_demo
gic-demo-base
Commits
5cf7a0e1
Commit
5cf7a0e1
authored
Jun 11, 2019
by
朱瑞泽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加提示
parent
b63329c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
+26
-4
DeployMain.java
.../src/main/java/com/gic/demo/helper/deploy/DeployMain.java
+1
-1
MyCommentGenerator.java
...ava/com/gic/demo/helper/generator/MyCommentGenerator.java
+25
-3
No files found.
gic-demo-helper/src/main/java/com/gic/demo/helper/
generator
/DeployMain.java
→
gic-demo-helper/src/main/java/com/gic/demo/helper/
deploy
/DeployMain.java
View file @
5cf7a0e1
package
com
.
gic
.
demo
.
helper
.
generator
;
package
com
.
gic
.
demo
.
helper
.
deploy
;
import
com.gic.deploy.DeployHelper
;
import
com.gic.deploy.DeployHelper
;
import
com.gic.deploy.config.DeployType
;
import
com.gic.deploy.config.DeployType
;
...
...
gic-demo-helper/src/main/java/com/gic/demo/helper/generator/MyCommentGenerator.java
View file @
5cf7a0e1
...
@@ -8,9 +8,7 @@ import org.mybatis.generator.api.dom.xml.XmlElement;
...
@@ -8,9 +8,7 @@ import org.mybatis.generator.api.dom.xml.XmlElement;
import
org.mybatis.generator.config.PropertyRegistry
;
import
org.mybatis.generator.config.PropertyRegistry
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.*
;
import
java.util.Properties
;
import
java.util.Set
;
import
static
org
.
mybatis
.
generator
.
internal
.
util
.
StringUtility
.
isTrue
;
import
static
org
.
mybatis
.
generator
.
internal
.
util
.
StringUtility
.
isTrue
;
...
@@ -140,7 +138,31 @@ public class MyCommentGenerator implements CommentGenerator {
...
@@ -140,7 +138,31 @@ public class MyCommentGenerator implements CommentGenerator {
topLevelClass
.
addJavaDocLine
(
" */"
);
topLevelClass
.
addJavaDocLine
(
" */"
);
}
}
private
final
static
String
MAPPER_METHOD_DOC
=
"/**\n"
+
" * %s\n"
+
" *\n"
+
" * @param %s %s\n"
+
" * @return %s\n"
+
" */"
;
private
final
static
Map
<
String
,
String
[]>
MAPPER_METHOD_DOC_MAP
;
static
{
MAPPER_METHOD_DOC_MAP
=
new
HashMap
<>();
MAPPER_METHOD_DOC_MAP
.
put
(
"deleteByPrimaryKey"
,
new
String
[]{
"根据主键删除"
,
"主键"
,
"更新条目数"
});
MAPPER_METHOD_DOC_MAP
.
put
(
"insert"
,
new
String
[]{
"插入一条记录"
,
"实体对象"
,
"更新条目数"
});
MAPPER_METHOD_DOC_MAP
.
put
(
"insertSelective"
,
new
String
[]{
"动态插入一条记录"
,
"实体对象"
,
"更新条目数"
});
MAPPER_METHOD_DOC_MAP
.
put
(
"selectByPrimaryKey"
,
new
String
[]{
"根据主键查询"
,
"主键"
,
"实体对象"
});
MAPPER_METHOD_DOC_MAP
.
put
(
"updateByPrimaryKeySelective"
,
new
String
[]{
"根据主键动态更新记录"
,
"实体对象"
,
"更新条目数"
});
MAPPER_METHOD_DOC_MAP
.
put
(
"updateByPrimaryKeyWithBLOBs"
,
new
String
[]{
"根据主键更新记录,包括二进制大对象"
,
"实体对象"
,
"更新条目数"
});
MAPPER_METHOD_DOC_MAP
.
put
(
"updateByPrimaryKey"
,
new
String
[]{
"根据主键更新记录"
,
"实体对象"
,
"更新条目数"
});
}
public
void
addGeneralMethodComment
(
Method
method
,
IntrospectedTable
introspectedTable
)
{
public
void
addGeneralMethodComment
(
Method
method
,
IntrospectedTable
introspectedTable
)
{
if
(
MAPPER_METHOD_DOC_MAP
.
containsKey
(
method
.
getName
()))
{
String
[]
strings
=
MAPPER_METHOD_DOC_MAP
.
get
(
method
.
getName
());
method
.
addJavaDocLine
(
String
.
format
(
MAPPER_METHOD_DOC
,
strings
[
0
],
method
.
getParameters
().
iterator
().
next
().
getName
(),
strings
[
1
],
strings
[
2
]));
}
}
}
public
void
addGetterComment
(
Method
method
,
IntrospectedTable
introspectedTable
,
public
void
addGetterComment
(
Method
method
,
IntrospectedTable
introspectedTable
,
...
...
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