Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
128848f5
Commit
128848f5
authored
Jun 08, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swagger3 鉴权调整
parent
8e369e01
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
75 additions
and
29 deletions
+75
-29
pom.xml
yifu-common/pom.xml
+1
-0
pom.xml
yifu-common/yifu-common-dapr/pom.xml
+1
-1
pom.xml
yifu-common/yifu-common-swagger/pom.xml
+32
-0
Swagger3Config.java
...ud/plus/v1/yifu/common/swagger/config/Swagger3Config.java
+3
-1
spring.factories
...mmon-swagger/src/main/resources/META-INF/spring.factories
+5
-0
pom.xml
yifu-upms/yifu-upms-biz/pom.xml
+3
-8
AppController.java
...fu.cloud.plus.v1/yifu/admin/controller/AppController.java
+0
-1
DeptController.java
...u.cloud.plus.v1/yifu/admin/controller/DeptController.java
+0
-1
DictController.java
...u.cloud.plus.v1/yifu/admin/controller/DictController.java
+0
-1
FileController.java
...u.cloud.plus.v1/yifu/admin/controller/FileController.java
+0
-1
LogController.java
...fu.cloud.plus.v1/yifu/admin/controller/LogController.java
+0
-1
MenuController.java
...u.cloud.plus.v1/yifu/admin/controller/MenuController.java
+0
-1
OauthClientDetailsController.java
...1/yifu/admin/controller/OauthClientDetailsController.java
+0
-1
PostController.java
...u.cloud.plus.v1/yifu/admin/controller/PostController.java
+0
-1
PublicParamController.java
....plus.v1/yifu/admin/controller/PublicParamController.java
+0
-1
RegisterController.java
...oud.plus.v1/yifu/admin/controller/RegisterController.java
+7
-4
RoleController.java
...u.cloud.plus.v1/yifu/admin/controller/RoleController.java
+0
-1
TokenController.java
....cloud.plus.v1/yifu/admin/controller/TokenController.java
+0
-1
UserController.java
...u.cloud.plus.v1/yifu/admin/controller/UserController.java
+0
-2
pom.xml
yifu-visual/yifu-codegen/pom.xml
+2
-2
application.yml
yifu-visual/yifu-codegen/src/main/resources/application.yml
+21
-0
No files found.
yifu-common/pom.xml
View file @
128848f5
...
...
@@ -40,5 +40,6 @@
<module>
yifu-common-security
</module>
<module>
yifu-common-test
</module>
<module>
yifu-common-dapr
</module>
<module>
yifu-common-swagger
</module>
</modules>
</project>
yifu-common/yifu-common-dapr/pom.xml
View file @
128848f5
...
...
@@ -10,7 +10,7 @@
<modelVersion>
4.0.0
</modelVersion>
<description>
dapr引入
</description>
<artifactId>
yifu-common-dapr
</artifactId>
<packaging>
jar
</packaging>
<dependencies>
<dependency>
...
...
yifu-common/yifu-common-swagger/pom.xml
0 → 100644
View file @
128848f5
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
yifu-common
</artifactId>
<groupId>
com.yifu.cloud.plus.v1
</groupId>
<version>
1.0.0
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<description>
swagger引入
</description>
<artifactId>
yifu-common-swagger
</artifactId>
<name>
yifu-common-swagger
</name>
<packaging>
jar
</packaging>
<dependencies>
<dependency>
<groupId>
io.swagger.core.v3
</groupId>
<artifactId>
swagger-annotations
</artifactId>
<version>
2.2.0
</version>
</dependency>
<dependency>
<groupId>
org.springdoc
</groupId>
<artifactId>
springdoc-openapi-ui
</artifactId>
<version>
1.6.8
</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>
8
</maven.compiler.source>
<maven.compiler.target>
8
</maven.compiler.target>
</properties>
</project>
yifu-
upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin
/config/Swagger3Config.java
→
yifu-
common/yifu-common-swagger/src/main/java/com/yifu/cloud/plus/v1/yifu/common/swagger
/config/Swagger3Config.java
View file @
128848f5
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
config
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
swagger
.
config
;
import
io.swagger.v3.oas.annotations.ExternalDocumentation
;
...
...
@@ -9,6 +9,7 @@ import io.swagger.v3.oas.annotations.info.Contact;
import
io.swagger.v3.oas.annotations.info.Info
;
import
io.swagger.v3.oas.annotations.security.SecurityRequirement
;
import
io.swagger.v3.oas.annotations.security.SecurityScheme
;
import
org.springframework.context.annotation.Configuration
;
/**
* @author fxj * @date 2022年05月31日 17:29 @description
...
...
@@ -26,6 +27,7 @@ import io.swagger.v3.oas.annotations.security.SecurityScheme;
)
)
@SecurityScheme
(
type
=
SecuritySchemeType
.
HTTP
,
name
=
"JWT"
,
scheme
=
"bearer"
,
in
=
SecuritySchemeIn
.
HEADER
)
@Configuration
//@SecurityScheme(type = SecuritySchemeType.OAUTH2,flows = @OAuthFlow( implicit = @OAuthFlow(authorizationUrl = "http://yifu-auth/oauth/check_token",
// scopes = @OAuthScope(name = "write:pets", description = "modify pets in your account"))))
public
class
Swagger3Config
{
...
...
yifu-common/yifu-common-swagger/src/main/resources/META-INF/spring.factories
0 → 100644
View file @
128848f5
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yifu.cloud.plus.v1.yifu.common.swagger.config.Swagger3Config
yifu-upms/yifu-upms-biz/pom.xml
View file @
128848f5
...
...
@@ -62,9 +62,8 @@
<version>3.0.0</version>
</dependency>-->
<dependency>
<groupId>
org.springdoc
</groupId>
<artifactId>
springdoc-openapi-ui
</artifactId>
<version>
1.6.8
</version>
<groupId>
com.yifu.cloud.plus.v1
</groupId>
<artifactId>
yifu-common-swagger
</artifactId>
</dependency>
<!--<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
...
...
@@ -104,11 +103,7 @@
<groupId>
com.yifu.cloud.plus.v1
</groupId>
<artifactId>
yifu-common-test
</artifactId>
</dependency>
<dependency>
<groupId>
io.swagger.core.v3
</groupId>
<artifactId>
swagger-models
</artifactId>
<version>
2.1.12
</version>
</dependency>
</dependencies>
<build>
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/AppController.java
View file @
128848f5
...
...
@@ -26,7 +26,6 @@ import org.springframework.web.bind.annotation.RestController;
@AllArgsConstructor
@RequestMapping
(
"/app"
)
@Tag
(
name
=
"移动端登录模块"
)
@SecurityRequirement
(
name
=
HttpHeaders
.
AUTHORIZATION
)
public
class
AppController
{
private
final
AppService
appService
;
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/DeptController.java
View file @
128848f5
...
...
@@ -44,7 +44,6 @@ import java.util.List;
@RequiredArgsConstructor
@RequestMapping
(
"/dept"
)
@Tag
(
name
=
"部门管理模块"
)
@SecurityRequirement
(
name
=
HttpHeaders
.
AUTHORIZATION
)
public
class
DeptController
{
private
final
SysDeptService
sysDeptService
;
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/DictController.java
View file @
128848f5
...
...
@@ -51,7 +51,6 @@ import java.util.List;
@RequiredArgsConstructor
@RequestMapping
(
"/dict"
)
@Tag
(
name
=
"字典管理模块"
)
@SecurityRequirement
(
name
=
HttpHeaders
.
AUTHORIZATION
)
public
class
DictController
{
private
final
SysDictItemService
sysDictItemService
;
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/FileController.java
View file @
128848f5
...
...
@@ -49,7 +49,6 @@ import javax.servlet.http.HttpServletResponse;
@RequiredArgsConstructor
@RequestMapping
(
"/sys-file"
)
@Tag
(
name
=
"文件管理模块"
)
@SecurityRequirement
(
name
=
HttpHeaders
.
AUTHORIZATION
)
public
class
FileController
{
private
final
SysFileService
sysFileService
;
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/LogController.java
View file @
128848f5
...
...
@@ -45,7 +45,6 @@ import java.util.List;
@RequiredArgsConstructor
@RequestMapping
(
"/log"
)
@Tag
(
name
=
"日志管理模块"
)
@SecurityRequirement
(
name
=
HttpHeaders
.
AUTHORIZATION
)
public
class
LogController
{
private
final
SysLogService
sysLogService
;
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/MenuController.java
View file @
128848f5
...
...
@@ -43,7 +43,6 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
@RequestMapping
(
"/menu"
)
@Tag
(
name
=
"菜单管理模块"
)
@SecurityRequirement
(
name
=
HttpHeaders
.
AUTHORIZATION
)
public
class
MenuController
{
private
final
SysMenuService
sysMenuService
;
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/OauthClientDetailsController.java
View file @
128848f5
...
...
@@ -45,7 +45,6 @@ import java.util.List;
@RequiredArgsConstructor
@RequestMapping
(
"/client"
)
@Tag
(
name
=
"客户端管理模块"
)
@SecurityRequirement
(
name
=
HttpHeaders
.
AUTHORIZATION
)
public
class
OauthClientDetailsController
{
private
final
SysOauthClientDetailsService
sysOauthClientDetailsService
;
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/PostController.java
View file @
128848f5
...
...
@@ -45,7 +45,6 @@ import java.util.List;
@RequiredArgsConstructor
@RequestMapping
(
"/post"
)
@Tag
(
name
=
"岗位管理模块"
)
@SecurityRequirement
(
name
=
HttpHeaders
.
AUTHORIZATION
)
public
class
PostController
{
private
final
SysPostService
sysPostService
;
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/PublicParamController.java
View file @
128848f5
...
...
@@ -42,7 +42,6 @@ import org.springframework.web.bind.annotation.*;
@RequiredArgsConstructor
@RequestMapping
(
"/param"
)
@Tag
(
name
=
"公共参数配置"
)
@SecurityRequirement
(
name
=
HttpHeaders
.
AUTHORIZATION
)
public
class
PublicParamController
{
private
final
SysPublicParamService
sysPublicParamService
;
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/RegisterController.java
View file @
128848f5
...
...
@@ -7,10 +7,7 @@ import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
/**
* @author lengleng
...
...
@@ -38,4 +35,10 @@ public class RegisterController {
return
userService
.
registerUser
(
userDto
);
}
@SysLog
(
"test"
)
@GetMapping
(
"/test"
)
public
R
<
String
>
registerUser
(
String
name
)
{
return
R
.
ok
(
name
);
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/RoleController.java
View file @
128848f5
...
...
@@ -47,7 +47,6 @@ import java.util.List;
@RequiredArgsConstructor
@RequestMapping
(
"/role"
)
@Tag
(
name
=
"角色管理模块"
)
@SecurityRequirement
(
name
=
HttpHeaders
.
AUTHORIZATION
)
public
class
RoleController
{
private
final
SysRoleService
sysRoleService
;
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/TokenController.java
View file @
128848f5
...
...
@@ -34,7 +34,6 @@ import java.util.Map;
@RequiredArgsConstructor
@RequestMapping
(
"/token"
)
@Tag
(
name
=
"令牌管理模块"
)
@SecurityRequirement
(
name
=
HttpHeaders
.
AUTHORIZATION
)
public
class
TokenController
{
//private final RemoteTokenService remoteTokenService;
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/UserController.java
View file @
128848f5
...
...
@@ -56,8 +56,6 @@ import java.util.Set;
@RestController
@RequiredArgsConstructor
@RequestMapping
(
"/user"
)
@Tag
(
name
=
"用户管理模块"
)
@SecurityRequirement
(
name
=
HttpHeaders
.
AUTHORIZATION
)
public
class
UserController
{
private
final
SysUserService
userService
;
...
...
yifu-visual/yifu-codegen/pom.xml
View file @
128848f5
...
...
@@ -32,10 +32,10 @@
<dependencies>
<!--接口文档-->
<!--
<dependency>
<dependency>
<groupId>
com.yifu.cloud.plus.v1
</groupId>
<artifactId>
yifu-common-swagger
</artifactId>
</dependency>
-->
</dependency>
<!--注册中心客户端-->
<!--<dependency>
<groupId>com.alibaba.cloud</groupId>
...
...
yifu-visual/yifu-codegen/src/main/resources/application.yml
View file @
128848f5
...
...
@@ -39,3 +39,24 @@ ignore:
urls
:
-
/v2/api-docs
-
/actuator/**
springdoc
:
api-docs
:
#是否开启文档功能
enabled
:
true
#swagger后端请求地址
path
:
/api-docs
swagger-ui
:
#自定义swagger前端请求路径,输入http:127.0.0.1:8080/test会自动重定向到swagger页面
path
:
/api/codegen
#包扫描路径
packages-to-scan
:
com.yifu.cloud.plus.v1.yifu.codegen.controller
#这里定义了两个分组,可定义多个,也可以不定义
group-configs
:
#分组名
#- group: admin
#按路径匹配
# pathsToMatch: /admin/**
#分组名
-
group
:
codegen
#按包路径匹配
packagesToScan
:
com.yifu.cloud.plus.v1.yifu.codegen.controller
\ No newline at end of file
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