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
6041186d
Commit
6041186d
authored
Feb 19, 2020
by
bianpeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改模板,和字段
parent
b6572ef2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
11 deletions
+7
-11
pom.xml
pom.xml
+2
-2
SwaggerConfig.ftl
src/main/resources/freemarker/ftl/SwaggerConfig.ftl
+4
-3
controller.ftl
src/main/resources/freemarker/ftl/controller.ftl
+0
-5
MyGenerator.java
src/test/java/com/flying/cattle/mdg/MyGenerator.java
+1
-1
No files found.
pom.xml
View file @
6041186d
...
...
@@ -37,9 +37,9 @@
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<java.version>
1.8
</java.version>
<druid.version>
1.1.16
</druid.version>
<mysql-connector-java.version>
8.0.1
5
</mysql-connector-java.version>
<mysql-connector-java.version>
8.0.1
8
</mysql-connector-java.version>
<slf4j-api.version>
1.7.26
</slf4j-api.version>
<lombok.version>
1.18.
6
</lombok.version>
<lombok.version>
1.18.
10
</lombok.version>
<freemarker.version>
2.3.28
</freemarker.version>
<!-- 打包跳过单元测试 -->
<skipTests>
true
</skipTests>
...
...
src/main/resources/freemarker/ftl/SwaggerConfig.ftl
View file @
6041186d
...
...
@@ -29,19 +29,20 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@
EnableSwagger2
public
class
SwaggerConfig
{
@
Value
(
"${
r'${server.port}'
}"
)
private
static
String
port
;
@
Value
(
"${
swagger.enable
}"
)
private
Boolean
swagger_enable
;
public
static
String
CONTROLLER_URL
=
"${controllerUrl}"
;
//
Swagger
扫描的接口路径
public
static
String
SWAGGER_TITLE
=
"API文档-${author}"
;
//
Swagger
接口文档标题
public
static
String
SWAGGER_DESCRIPTION
=
"API文档"
;
//
Swagger
接口文档描述
public
static
String
SWAGGER_VERSION
=
"1.0"
;
//
Swagger
接口文档版本
public
final
static
String
SWAGGER_URL
=
"http://127.0.0.1:
"
+
port
;
//
Swagger
项目服务的
URL
public
final
static
String
SWAGGER_URL
=
"http://127.0.0.1:
8080"
;
//
Swagger
项目服务的
URL
//
验证的页面
http
://
127.0.0.1
:
8080
/
swagger
-
ui
.
html
@
Bean
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
enable
(
swagger_enable
)
.
apiInfo
(
apiInfo
())
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
CONTROLLER_URL
))
...
...
src/main/resources/freemarker/ftl/controller.ftl
View file @
6041186d
...
...
@@ -14,8 +14,6 @@ import org.springframework.web.bind.annotation.RestController;
<#
if
isSwagger
==
"true"
>
import
io
.
swagger
.
annotations
.
Api
;
</#
if
>
import
org
.
slf4j
.
Logger
;
import
org
.
slf4j
.
LoggerFactory
;
/**
*
<
p
>
自动生成工具:
mybatis
-
dsc
-
generator
</
p
>
*
...
...
@@ -31,7 +29,5 @@ import org.slf4j.LoggerFactory;
@
RestController
@
RequestMapping
(
"/${objectName}"
)
public
class
${
entityName
}
Controller
extends
AbstractController
<${
entityName
}
Service
,${
entityName
}>{
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
}
\ No newline at end of file
src/test/java/com/flying/cattle/mdg/MyGenerator.java
View file @
6041186d
...
...
@@ -4,7 +4,7 @@
* Copyright(c) 2018 BianPeng Co. Ltd.
* All right reserved.
*/
package
com
.
buybit
.
test
;
package
com
.
flying
.
cattle
.
mdg
;
import
java.sql.SQLException
;
import
java.util.Date
;
...
...
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