Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ydl-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
余保谷
ydl-generator
Commits
7afec11c
Commit
7afec11c
authored
Jul 07, 2021
by
yubaogu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tett
parent
306bb19e
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
14 deletions
+13
-14
AbstractController.ftl
src/main/resources/freemarker/ftl/AbstractController.ftl
+0
-4
dao.ftl
src/main/resources/freemarker/ftl/dao.ftl
+2
-1
entity.ftl
src/main/resources/freemarker/ftl/entity.ftl
+2
-3
mapper.ftl
src/main/resources/freemarker/ftl/mapper.ftl
+1
-1
service.ftl
src/main/resources/freemarker/ftl/service.ftl
+2
-1
serviceImpl.ftl
src/main/resources/freemarker/ftl/serviceImpl.ftl
+4
-2
MyGenerator.java
src/test/java/com/flying/cattle/mdg/MyGenerator.java
+2
-2
No files found.
src/main/resources/freemarker/ftl/AbstractController.ftl
View file @
7afec11c
...
...
@@ -10,10 +10,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org
.
springframework
.
web
.
bind
.
annotation
.
GetMapping
;
import
org
.
springframework
.
web
.
bind
.
annotation
.
PathVariable
;
import
org
.
springframework
.
web
.
bind
.
annotation
.
PostMapping
;
import
com
.
baomidou
.
mybatisplus
.
core
.
conditions
.
query
.
QueryWrapper
;
import
com
.
baomidou
.
mybatisplus
.
core
.
metadata
.
IPage
;
import
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
;
import
com
.
baomidou
.
mybatisplus
.
extension
.
service
.
IService
;
import
com
.
gitee
.
flying
.
cattle
.
mdg
.
aid
.
JsonResult
;
import
com
.
gitee
.
flying
.
cattle
.
mdg
.
aid
.
PageParam
;
<#
if
isSwagger
==
"true"
>
...
...
src/main/resources/freemarker/ftl/dao.ftl
View file @
7afec11c
...
...
@@ -6,8 +6,9 @@
*/
package
${
daoUrl
};
import
com
.
baomidou
.
mybatisplus
.
core
.
mapper
.
BaseMapper
;
import
com
.
ydl
.
common
.
service
.
BaseMapper
;
import
org
.
apache
.
ibatis
.
annotations
.
Mapper
;
import
org
.
apache
.
ibatis
.
annotations
.
Param
;
import
${
entityUrl
}.${
entityName
};
/**
...
...
src/main/resources/freemarker/ftl/entity.ftl
View file @
7afec11c
...
...
@@ -5,9 +5,8 @@
*
All
right
reserved
.
*/
package
${
entityUrl
};
import
com
.
baomidou
.
mybatisplus
.
annotation
.
IdType
;
import
com
.
baomidou
.
mybatisplus
.
annotation
.
TableId
;
import
com
.
baomidou
.
mybatisplus
.
extension
.
activerecord
.
Model
;
import
com
.
fasterxml
.
jackson
.
annotation
.
JsonFormat
;
<#
if
isSwagger
==
"true"
>
import
io
.
swagger
.
annotations
.
ApiModelProperty
;
...
...
src/main/resources/freemarker/ftl/mapper.ftl
View file @
7afec11c
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"${daoUrl}.${entityName}
Dao"
>
<mapper
namespace=
"${daoUrl}.${entityName}
Mapper"
>
<resultMap
id=
"BaseResultMap"
type=
"${entityUrl}.${entityName}"
>
<
#list cis as ci>
...
...
src/main/resources/freemarker/ftl/service.ftl
View file @
7afec11c
...
...
@@ -6,8 +6,9 @@
*/
package
${
serviceUrl
};
import
com
.
ydl
.
common
.
service
.
IService
;
import
${
entityUrl
}.${
entityName
};
import
com
.
baomidou
.
mybatisplus
.
extension
.
service
.
IService
;
/**
*
@
Description
:
TODO
(${
entityComment
}
服务层
)
*
@
version
:
${
version
}
...
...
src/main/resources/freemarker/ftl/serviceImpl.ftl
View file @
7afec11c
...
...
@@ -10,8 +10,10 @@ import ${entityUrl}.${entityName};
import
${
daoUrl
}.${
entityName
}
Dao
;
import
${
serviceUrl
}.${
entityName
}
Service
;
import
org
.
springframework
.
stereotype
.
Service
;
import
com
.
baomidou
.
mybatisplus
.
extension
.
service
.
impl
.
ServiceImpl
;
import
com
.
ydl
.
common
.
service
.
impl
.
BaseService
;
import
org
.
springframework
.
stereotype
.
Service
;
import
tk
.
mybatis
.
mapper
.
entity
.
Example
;
import
com
.
github
.
pagehelper
.
PageHelper
;
/**
*
@
Description
:
TODO
(${
entityComment
}
服务实现
)
*
...
...
src/test/java/com/flying/cattle/mdg/MyGenerator.java
View file @
7afec11c
...
...
@@ -46,7 +46,7 @@ public class MyGenerator {
public
static
final
String
XML_URL
=
"com.buybit.power.mapper.xml"
;
public
static
final
String
SERVICE_URL
=
"com.buybit.power.service"
;
public
static
final
String
SERVICE_IMPL_URL
=
"com.buybit.power.service.impl"
;
public
static
final
String
CONTROLLER_URL
=
"com.buybit.power.
web
"
;
public
static
final
String
CONTROLLER_URL
=
"com.buybit.power.
api
"
;
//是否是Swagger配置
public
static
final
String
IS_SWAGGER
=
"true"
;
...
...
@@ -60,7 +60,7 @@ public class MyGenerator {
bi
.
setEntityComment
(
CLASSCOMMENT
);
try
{
bi
=
EntityInfoUtil
.
getInfo
(
bi
);
String
fileUrl
=
"D:\\ydlwork\\generator\\"
;
// 生成文件存放位置
String
fileUrl
=
"D:\\ydlwork\\generator\\
demo\\src\\main\\java\\
"
;
// 生成文件存放位置
//开始生成文件
String
aa1
=
Generator
.
createEntity
(
fileUrl
,
bi
).
toString
();
String
aa2
=
Generator
.
createDao
(
fileUrl
,
bi
).
toString
();
...
...
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