Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
renren-generator
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
吴迪
renren-generator
Commits
cd440901
Commit
cd440901
authored
Mar 04, 2019
by
Mark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新模板到renren-fast3.0
parent
e60b6e65
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
67 additions
and
27 deletions
+67
-27
.gitignore
.gitignore
+24
-0
generator.properties
src/main/resources/generator.properties
+28
-0
Controller.java.vm
src/main/resources/template/Controller.java.vm
+3
-3
Dao.java.vm
src/main/resources/template/Dao.java.vm
+1
-1
Entity.java.vm
src/main/resources/template/Entity.java.vm
+4
-16
Service.java.vm
src/main/resources/template/Service.java.vm
+1
-1
ServiceImpl.java.vm
src/main/resources/template/ServiceImpl.java.vm
+6
-6
No files found.
.gitignore
0 → 100644
View file @
cd440901
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar
*.iml
.idea
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
src/main/resources/generator.properties
View file @
cd440901
...
...
@@ -33,3 +33,30 @@ longtext=String
date
=
Date
datetime
=
Date
timestamp
=
Date
NUMBER
=
Integer
INT
=
Integer
INTEGER
=
Integer
BINARY_INTEGER
=
Integer
LONG
=
String
FLOAT
=
Float
BINARY_FLOAT
=
Float
DOUBLE
=
Double
BINARY_DOUBLE
=
Double
DECIMAL
=
BigDecimal
CHAR
=
String
VARCHAR
=
String
VARCHAR2
=
String
NVARCHAR
=
String
NVARCHAR2
=
String
CLOB
=
String
BLOB
=
String
DATE
=
Date
DATETIME
=
Date
TIMESTAMP
=
Date
TIMESTAMP(6)=Date
int8
=
Long
int4
=
Integer
int2
=
Integer
numeric
=
BigDecimal
\ No newline at end of file
src/main/resources/template/Controller.java.vm
View file @
cd440901
...
...
@@ -49,7 +49,7 @@ public class ${className}Controller {
@
RequestMapping
(
"/info/{${pk.attrname}}"
)
@
RequiresPermissions
(
"${moduleName}:${pathName}:info"
)
public
R
info
(@
PathVariable
(
"${pk.attrname}"
)
${
pk
.
attrType
}
${
pk
.
attrname
}){
${
className
}
Entity
${
classname
}
=
${
classname
}
Service
.
selec
tById
(${
pk
.
attrname
});
${
className
}
Entity
${
classname
}
=
${
classname
}
Service
.
ge
tById
(${
pk
.
attrname
});
return
R
.
ok
().
put
(
"${classname}"
,
${
classname
});
}
...
...
@@ -60,7 +60,7 @@ public class ${className}Controller {
@
RequestMapping
(
"/save"
)
@
RequiresPermissions
(
"${moduleName}:${pathName}:save"
)
public
R
save
(@
RequestBody
${
className
}
Entity
${
classname
}){
${
classname
}
Service
.
insert
(${
classname
});
${
classname
}
Service
.
save
(${
classname
});
return
R
.
ok
();
}
...
...
@@ -82,7 +82,7 @@ public class ${className}Controller {
@
RequestMapping
(
"/delete"
)
@
RequiresPermissions
(
"${moduleName}:${pathName}:delete"
)
public
R
delete
(@
RequestBody
${
pk
.
attrType
}[]
${
pk
.
attrname
}
s
){
${
classname
}
Service
.
deleteBatch
Ids
(
Arrays
.
asList
(${
pk
.
attrname
}
s
));
${
classname
}
Service
.
removeBy
Ids
(
Arrays
.
asList
(${
pk
.
attrname
}
s
));
return
R
.
ok
();
}
...
...
src/main/resources/template/Dao.java.vm
View file @
cd440901
package
${
package
}.${
moduleName
}.
dao
;
import
${
package
}.${
moduleName
}.
entity
.${
className
}
Entity
;
import
com
.
baomidou
.
mybatisplus
.
mapper
.
BaseMapper
;
import
com
.
baomidou
.
mybatisplus
.
core
.
mapper
.
BaseMapper
;
import
org
.
apache
.
ibatis
.
annotations
.
Mapper
;
/**
...
...
src/main/resources/template/Entity.java.vm
View file @
cd440901
package
${
package
}.${
moduleName
}.
entity
;
import
com
.
baomidou
.
mybatisplus
.
annotation
s
.
TableId
;
import
com
.
baomidou
.
mybatisplus
.
annotation
s
.
TableName
;
import
com
.
baomidou
.
mybatisplus
.
annotation
.
TableId
;
import
com
.
baomidou
.
mybatisplus
.
annotation
.
TableName
;
#
if
(${
hasBigDecimal
})
import
java
.
math
.
BigDecimal
;
#
end
import
java
.
io
.
Serializable
;
import
java
.
util
.
Date
;
import
lombok
.
Data
;
/**
*
${
comments
}
...
...
@@ -16,6 +17,7 @@ import java.util.Date;
*
@
email
${
email
}
*
@
date
${
datetime
}
*/
@
Data
@
TableName
(
"${tableName}"
)
public
class
${
className
}
Entity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -30,18 +32,4 @@ public class ${className}Entity implements Serializable {
private
$
column
.
attrType
$
column
.
attrname
;
#
end
#
foreach
($
column
in
$
columns
)
/**
*
设置:
${
column
.
comments
}
*/
public
void
set
${
column
.
attrName
}($
column
.
attrType
$
column
.
attrname
)
{
this
.$
column
.
attrname
=
$
column
.
attrname
;
}
/**
*
获取:
${
column
.
comments
}
*/
public
$
column
.
attrType
get
${
column
.
attrName
}()
{
return
$
column
.
attrname
;
}
#
end
}
src/main/resources/template/Service.java.vm
View file @
cd440901
package
${
package
}.${
moduleName
}.
service
;
import
com
.
baomidou
.
mybatisplus
.
service
.
IService
;
import
com
.
baomidou
.
mybatisplus
.
extension
.
service
.
IService
;
import
${
mainPath
}.
common
.
utils
.
PageUtils
;
import
${
package
}.${
moduleName
}.
entity
.${
className
}
Entity
;
...
...
src/main/resources/template/ServiceImpl.java.vm
View file @
cd440901
...
...
@@ -2,9 +2,9 @@ package ${package}.${moduleName}.service.impl;
import
org
.
springframework
.
stereotype
.
Service
;
import
java
.
util
.
Map
;
import
com
.
baomidou
.
mybatisplus
.
mapper
.
Entit
yWrapper
;
import
com
.
baomidou
.
mybatisplus
.
plugins
.
Page
;
import
com
.
baomidou
.
mybatisplus
.
service
.
impl
.
ServiceImpl
;
import
com
.
baomidou
.
mybatisplus
.
core
.
conditions
.
query
.
Quer
yWrapper
;
import
com
.
baomidou
.
mybatisplus
.
core
.
metadata
.
I
Page
;
import
com
.
baomidou
.
mybatisplus
.
extension
.
service
.
impl
.
ServiceImpl
;
import
${
mainPath
}.
common
.
utils
.
PageUtils
;
import
${
mainPath
}.
common
.
utils
.
Query
;
...
...
@@ -18,9 +18,9 @@ public class ${className}ServiceImpl extends ServiceImpl<${className}Dao, ${clas
@
Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
Page
<${
className
}
Entity
>
page
=
this
.
selectP
age
(
new
Query
<${
className
}
Entity
>(
params
).
getPage
(
),
new
Entit
yWrapper
<${
className
}
Entity
>()
IPage
<${
className
}
Entity
>
page
=
this
.
p
age
(
new
Query
<${
className
}
Entity
>(
).
getPage
(
params
),
new
Quer
yWrapper
<${
className
}
Entity
>()
);
return
new
PageUtils
(
page
);
...
...
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