Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
roncoo
roncoo-education
提交
8730e89e
R
roncoo-education
项目概览
roncoo
/
roncoo-education
10 个月 前同步成功
通知
146
Star
5
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roncoo-education
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
8730e89e
编写于
7月 05, 2022
作者:
F
fengyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
网关增加聚合接口文档,更方便接口文档的查看和对接
上级
6ab7b639
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
103 addition
and
8 deletion
+103
-8
CHANGELOG.md
CHANGELOG.md
+1
-0
roncoo-education-app-gateway/src/main/java/com/roncoo/education/app/gateway/swagger/SwaggerHandler.java
.../roncoo/education/app/gateway/swagger/SwaggerHandler.java
+50
-0
roncoo-education-app-gateway/src/main/java/com/roncoo/education/app/gateway/swagger/SwaggerResourceConfig.java
.../education/app/gateway/swagger/SwaggerResourceConfig.java
+47
-0
roncoo-education-common/roncoo-education-common-core/src/main/resources/config.properties
...ducation-common-core/src/main/resources/config.properties
+0
-2
roncoo-education-common/roncoo-education-common-core/src/main/resources/config/test/config.properties
...mon-core/src/main/resources/config/test/config.properties
+0
-1
roncoo-education-common/roncoo-education-common-core/src/main/resources/system.properties
...ducation-common-core/src/main/resources/system.properties
+5
-5
未找到文件。
CHANGELOG.md
浏览文件 @
8730e89e
...
...
@@ -7,6 +7,7 @@
4.
切换网关组件为Spring CLoud Gateway
5.
增加nacos_cofig.zip配置,nacos可以一键导入
6.
将file_storage的表file_type修改为file_classify
7.
网关增加聚合接口文档,更方便接口文档的查看和对接
---
###### v9.0.0-RELEASE
...
...
roncoo-education-app-gateway/src/main/java/com/roncoo/education/app/gateway/swagger/SwaggerHandler.java
0 → 100644
浏览文件 @
8730e89e
package
com.roncoo.education.app.gateway.swagger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
reactor.core.publisher.Mono
;
import
springfox.documentation.swagger.web.*
;
import
java.util.Optional
;
@RestController
public
class
SwaggerHandler
{
@Autowired
(
required
=
false
)
private
SecurityConfiguration
securityConfiguration
;
@Autowired
(
required
=
false
)
private
UiConfiguration
uiConfiguration
;
private
final
SwaggerResourcesProvider
swaggerResources
;
@Autowired
public
SwaggerHandler
(
SwaggerResourcesProvider
swaggerResources
)
{
this
.
swaggerResources
=
swaggerResources
;
}
@GetMapping
(
"/swagger-resources/configuration/security"
)
public
Mono
<
ResponseEntity
<
SecurityConfiguration
>>
securityConfiguration
()
{
return
Mono
.
just
(
new
ResponseEntity
<>(
Optional
.
ofNullable
(
securityConfiguration
)
.
orElse
(
SecurityConfigurationBuilder
.
builder
().
build
()),
HttpStatus
.
OK
));
}
@GetMapping
(
"/swagger-resources/configuration/ui"
)
public
Mono
<
ResponseEntity
<
UiConfiguration
>>
uiConfiguration
()
{
return
Mono
.
just
(
new
ResponseEntity
<>(
Optional
.
ofNullable
(
uiConfiguration
).
orElse
(
UiConfigurationBuilder
.
builder
().
build
()),
HttpStatus
.
OK
));
}
@GetMapping
(
"/swagger-resources"
)
public
Mono
<
ResponseEntity
>
swaggerResources
()
{
return
Mono
.
just
((
new
ResponseEntity
<>(
swaggerResources
.
get
(),
HttpStatus
.
OK
)));
}
}
roncoo-education-app-gateway/src/main/java/com/roncoo/education/app/gateway/swagger/SwaggerResourceConfig.java
0 → 100644
浏览文件 @
8730e89e
package
com.roncoo.education.app.gateway.swagger
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.cloud.gateway.config.GatewayProperties
;
import
org.springframework.cloud.gateway.route.RouteLocator
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.stereotype.Component
;
import
springfox.documentation.swagger.web.SwaggerResource
;
import
springfox.documentation.swagger.web.SwaggerResourcesProvider
;
import
java.util.ArrayList
;
import
java.util.List
;
@Slf4j
@Component
@Primary
@AllArgsConstructor
public
class
SwaggerResourceConfig
implements
SwaggerResourcesProvider
{
private
final
RouteLocator
routeLocator
;
private
final
GatewayProperties
gatewayProperties
;
@Override
public
List
<
SwaggerResource
>
get
()
{
List
<
SwaggerResource
>
resources
=
new
ArrayList
<>();
List
<
String
>
routes
=
new
ArrayList
<>();
routeLocator
.
getRoutes
().
subscribe
(
route
->
routes
.
add
(
route
.
getId
()));
gatewayProperties
.
getRoutes
().
stream
()
.
filter
(
routeDefinition
->
routes
.
contains
(
routeDefinition
.
getId
()))
.
forEach
(
route
->
{
route
.
getPredicates
().
forEach
(
predicateDefinition
->
resources
.
add
(
swaggerResource
(
route
.
getId
(),
"/v2/api-docs"
)));
});
return
resources
;
}
private
SwaggerResource
swaggerResource
(
String
name
,
String
location
)
{
SwaggerResource
swaggerResource
=
new
SwaggerResource
();
swaggerResource
.
setName
(
name
);
swaggerResource
.
setLocation
(
"/"
+
name
+
location
);
swaggerResource
.
setSwaggerVersion
(
"2.0"
);
return
swaggerResource
;
}
}
roncoo-education-common/roncoo-education-common-core/src/main/resources/config.properties
浏览文件 @
8730e89e
env
=
local
# 环境配置,这里可以放置不同环境的配置
roncoo-education-common/roncoo-education-common-core/src/main/resources/config/test/config.properties
浏览文件 @
8730e89e
env
=
test
# 测试环境的配置,打包的时候,会根据环境覆盖
roncoo-education-common/roncoo-education-common-core/src/main/resources/system.properties
浏览文件 @
8730e89e
#
视频存放路径
#
??????
period_video_path
=
/home/roncoo/file/video/
pic_path
=
/home/roncoo/file/pic/
#
本地上传文档路径
#
????????
doc_storage_path
=
C:/RonCoo/doc/
#
本地上传路径路径
#
????????
pic_storage_path
=
C:/RonCoo/pic/
#
测试课程
id
#
????
id
test_course
=
1085453180200448002
#
保利威视
#
????
polyv_uploadVideo
=
http://v.polyv.net/uc/services/rest?method=uploadfile
polyv_deleteVideo
=
http://api.polyv.net/v2/video/{userid}/del-video
polyv_question
=
http://v.polyv.net/uc/services/rest
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录