Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
d99ad5d9
Commit
d99ad5d9
authored
May 27, 2021
by
taabe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
使用tyboot框架自带swagger 配置
parent
35e8ee06
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
55 deletions
+3
-55
SwaggerConfig.java
.../java/org/amos/boot/biz/common/configs/SwaggerConfig.java
+0
-55
TestController.java
...g/amos/boot/module/tzs/biz/controller/TestController.java
+3
-0
No files found.
amos-boot-biz-common/src/main/java/org/amos/boot/biz/common/configs/SwaggerConfig.java
deleted
100644 → 0
View file @
35e8ee06
package
org
.
amos
.
boot
.
biz
.
common
.
configs
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.service.Contact
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
/**
* swagger配置类 模块如果需要引入则引入
*
* @author DELL
*/
@Configuration
@EnableSwagger2
public
class
SwaggerConfig
{
@Bean
public
Docket
api
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
groupName
(
"服务接口"
)
.
enable
(
true
)
.
apiInfo
(
apiInfo
())
.
select
()
.
apis
(
RequestHandlerSelectors
.
withMethodAnnotation
(
ApiOperation
.
class
))
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"org.amos.boot"
))
.
paths
(
PathSelectors
.
any
())
.
build
();
}
/**
* 构建 api文档的详细信息函数,注意这里的注解引用的是哪个
*/
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
//页面标题
.
title
(
"RestFul API"
)
//创建人
.
contact
(
new
Contact
(
"amos"
,
""
,
""
))
//版本号
.
version
(
"1.0"
)
//描述
.
description
(
"API 描述"
)
.
build
();
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/org/amos/boot/module/tzs/biz/controller/TestController.java
View file @
d99ad5d9
...
@@ -6,6 +6,8 @@ import org.amos.boot.biz.common.utils.CommonResponseUtil;
...
@@ -6,6 +6,8 @@ import org.amos.boot.biz.common.utils.CommonResponseUtil;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
/**
/**
...
@@ -17,6 +19,7 @@ public class TestController extends BaseController {
...
@@ -17,6 +19,7 @@ public class TestController extends BaseController {
@ApiOperation
(
value
=
"测试接口"
)
@ApiOperation
(
value
=
"测试接口"
)
@GetMapping
(
value
=
"/testGet"
)
@GetMapping
(
value
=
"/testGet"
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
public
ResponseModel
test
()
{
public
ResponseModel
test
()
{
return
CommonResponseUtil
.
success
();
return
CommonResponseUtil
.
success
();
}
}
...
...
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