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
21c47042
Commit
21c47042
authored
Jul 14, 2021
by
yubaogu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tett
parent
b90861ea
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
16 deletions
+18
-16
Generator.java
src/main/java/com/gitee/flying/cattle/mdg/util/Generator.java
+2
-2
service.ftl
src/main/resources/freemarker/ftl/service.ftl
+3
-2
serviceImpl.ftl
src/main/resources/freemarker/ftl/serviceImpl.ftl
+2
-1
MyGenerator.java
src/test/java/com/flying/cattle/mdg/MyGenerator.java
+11
-11
No files found.
src/main/java/com/gitee/flying/cattle/mdg/util/Generator.java
View file @
21c47042
...
...
@@ -110,9 +110,9 @@ public class Generator {
}
else
if
(
type
.
equals
(
"mapperxml"
))
{
return
url
+
pageToUrl
(
packageUrl
)+
entityName
+
"Mapper.xml"
;
}
else
if
(
type
.
equals
(
"service"
))
{
return
url
+
pageToUrl
(
packageUrl
)+
entityName
+
"
Service
.java"
;
return
url
+
pageToUrl
(
packageUrl
)+
entityName
+
"
Biz
.java"
;
}
else
if
(
type
.
equals
(
"serviceImpl"
))
{
return
url
+
pageToUrl
(
packageUrl
)+
entityName
+
"
Service
Impl.java"
;
return
url
+
pageToUrl
(
packageUrl
)+
entityName
+
"
Biz
Impl.java"
;
}
else
if
(
type
.
equals
(
"facade"
))
{
return
url
+
pageToUrl
(
packageUrl
)+
entityName
+
"Facade.java"
;
}
else
if
(
type
.
equals
(
"facadeImpl"
))
{
...
...
src/main/resources/freemarker/ftl/service.ftl
View file @
21c47042
/**
*
@
filename
:${
entityName
}
Service
${
createTime
}
*
@
filename
:${
entityName
}
Biz
${
createTime
}
*
@
project
${
project
}
${
version
}
*
Copyright
(
c
)
2020
${
author
}
Co
.
Ltd
.
*
All
right
reserved
.
...
...
@@ -15,6 +15,6 @@ import ${entityUrl}.${entityName};
*
@
author
:
${
author
}
*
*/
public
interface
${
entityName
}
Service
extends
IService
<${
entityName
}>
{
public
interface
${
entityName
}
Biz
extends
IService
<${
entityName
}>
{
}
\ No newline at end of file
src/main/resources/freemarker/ftl/serviceImpl.ftl
View file @
21c47042
...
...
@@ -21,6 +21,6 @@ import com.github.pagehelper.PageHelper;
*
*/
@
Service
public
class
${
entityName
}
Service
Impl
extends
BaseService
<${
entityName
}>
implements
${
entityName
}
Service
{
public
class
${
entityName
}
Biz
Impl
extends
BaseService
<${
entityName
}>
implements
${
entityName
}
Service
{
}
\ No newline at end of file
src/test/java/com/flying/cattle/mdg/MyGenerator.java
View file @
21c47042
...
...
@@ -52,18 +52,18 @@ public class MyGenerator implements Serializable {
public
static
final
String
TIME
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
new
Date
());
public
static
final
String
AGILE
=
new
Date
().
getTime
()
+
""
;
// 路径信息,分开路径方便聚合工程项目,微服务项目
public
static
String
ENTITY_URL
=
"com.ydl.*project*.po"
;
public
static
String
DAO_URL
=
"com.ydl.*project*.mapper"
;
public
static
String
ENTITY_URL
=
"com.ydl.*project*.
intf.
po"
;
public
static
String
DAO_URL
=
"com.ydl.*project*.
service.
mapper"
;
public
static
String
XML_URL
=
"sqlmap\\"
;
public
static
String
SERVICE_URL
=
"com.ydl.*project*.service"
;
public
static
String
SERVICE_IMPL_URL
=
"com.ydl.*project*.service.impl"
;
public
static
String
FACADE_URL
=
"com.ydl.*project*.facade"
;
public
static
String
FACADE_URL_IMPL
=
"com.ydl.*project*.facade"
;
public
static
String
CONTROLLER_URL
=
"com.ydl.*project*.api"
;
public
static
String
SERVICE_URL
=
"com.ydl.*project*.service
.biz
"
;
public
static
String
SERVICE_IMPL_URL
=
"com.ydl.*project*.service.
biz.
impl"
;
public
static
String
FACADE_URL
=
"com.ydl.*project*.
intf.
facade"
;
public
static
String
FACADE_URL_IMPL
=
"com.ydl.*project*.
service.
facade"
;
public
static
String
CONTROLLER_URL
=
"com.ydl.*project*.api
.apis
"
;
//是否是Swagger配置
public
static
final
String
IS_SWAGGER
=
"true"
;
public
static
final
String
PROJECT_NAME
=
"
user
"
;
public
static
final
String
PROJECT_NAME
=
"
doctor_role
"
;
public
static
void
main
(
String
[]
args
)
throws
IOException
{
System
.
out
.
println
(
MyGenerator
.
class
.
getResource
(
""
).
getPath
());
...
...
@@ -83,7 +83,7 @@ public class MyGenerator implements Serializable {
bi
.
setEntityComment
(
CLASSCOMMENT
);
try
{
bi
=
EntityInfoUtil
.
getInfo
(
bi
);
String
localproject
=
"D:\\ydlwork\\
user-center\\ydl-use
r\\"
;
String
localproject
=
"D:\\ydlwork\\
ydl-docto
r\\"
;
String
fileServiceUrl
=
localproject
+
"ydl-*project*-service\\src\\main\\"
+
"java\\"
;
// 生成文件存放位置
String
fileServiceMapper
=
localproject
+
"ydl-*project*-service\\src\\main\\"
+
"resources\\"
;
// 生成文件存放位置
String
fileIntfUrl
=
localproject
+
"ydl-*project*-intf\\src\\main\\java\\"
;
// 生成文件存放位置
...
...
@@ -104,8 +104,8 @@ public class MyGenerator implements Serializable {
// 是否创建swagger配置文件
//String aa7 = Generator.createSwaggerConfig(fileUrl, bi).toString();
//
String aa9 = Generator.createFacade(fileIntfUrl, bi).toString();
//
String aa10 = Generator.createFacadeImpl(fileServiceUrl, bi).toString();
String
aa9
=
Generator
.
createFacade
(
fileIntfUrl
,
bi
).
toString
();
String
aa10
=
Generator
.
createFacadeImpl
(
fileServiceUrl
,
bi
).
toString
();
System
.
out
.
println
(
aa1
);
System
.
out
.
println
(
aa2
);
...
...
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