Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lzh_me
Sureness
提交
24936c5a
Sureness
项目概览
lzh_me
/
Sureness
与 Fork 源项目一致
Fork自
sureness / Sureness
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Sureness
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
24936c5a
编写于
2月 06, 2021
作者:
sinat_25235033
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change contextPathRef to CONTEXT_PATH_REF
上级
99c3a474
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
19 addition
and
10 deletion
+19
-10
core/src/main/java/com/usthe/sureness/matcher/PathTreeProvider.java
...ain/java/com/usthe/sureness/matcher/PathTreeProvider.java
+11
-2
core/src/main/java/com/usthe/sureness/provider/annotation/AnnotationPathTreeProvider.java
...eness/provider/annotation/AnnotationPathTreeProvider.java
+2
-2
core/src/main/java/com/usthe/sureness/provider/ducument/DocumentPathTreeProvider.java
.../sureness/provider/ducument/DocumentPathTreeProvider.java
+2
-2
core/src/main/java/com/usthe/sureness/provider/ducument/DocumentResourceDefaultProvider.java
...ss/provider/ducument/DocumentResourceDefaultProvider.java
+2
-2
sample-tom/src/main/java/com/usthe/sureness/sample/tom/sureness/provider/DatabasePathTreeProvider.java
...ample/tom/sureness/provider/DatabasePathTreeProvider.java
+2
-2
未找到文件。
core/src/main/java/com/usthe/sureness/matcher/PathTreeProvider.java
浏览文件 @
24936c5a
...
@@ -16,7 +16,7 @@ public interface PathTreeProvider {
...
@@ -16,7 +16,7 @@ public interface PathTreeProvider {
* eg: springboot context path is: server.servlet.context-path = v2
* eg: springboot context path is: server.servlet.context-path = v2
* tomcat context path is: <context path="v2">
* tomcat context path is: <context path="v2">
*/
*/
AtomicReference
<
String
>
contextPathRef
=
new
AtomicReference
<
String
>();
AtomicReference
<
String
>
CONTEXT_PATH_REF
=
new
AtomicReference
<
>();
/**
/**
* set context path
* set context path
...
@@ -24,7 +24,16 @@ public interface PathTreeProvider {
...
@@ -24,7 +24,16 @@ public interface PathTreeProvider {
* @param contextPath context path
* @param contextPath context path
*/
*/
default
void
setContextPath
(
String
contextPath
)
{
default
void
setContextPath
(
String
contextPath
)
{
contextPathRef
.
set
(
contextPath
);
CONTEXT_PATH_REF
.
set
(
contextPath
);
}
/**
* get context path
* Please sync with your server context path settings use setContextPath
* @return context path
*/
default
String
getContextPath
()
{
return
CONTEXT_PATH_REF
.
get
();
}
}
/**
/**
...
...
core/src/main/java/com/usthe/sureness/provider/annotation/AnnotationPathTreeProvider.java
浏览文件 @
24936c5a
...
@@ -77,7 +77,7 @@ public class AnnotationPathTreeProvider implements PathTreeProvider {
...
@@ -77,7 +77,7 @@ public class AnnotationPathTreeProvider implements PathTreeProvider {
}
}
}
}
}
}
return
SurenessCommonUtil
.
attachContextPath
(
contextPathRef
.
get
(),
resource
);
return
SurenessCommonUtil
.
attachContextPath
(
getContextPath
(),
resource
);
}
}
@Override
@Override
...
@@ -100,7 +100,7 @@ public class AnnotationPathTreeProvider implements PathTreeProvider {
...
@@ -100,7 +100,7 @@ public class AnnotationPathTreeProvider implements PathTreeProvider {
}
}
}
}
}
}
return
SurenessCommonUtil
.
attachContextPath
(
contextPathRef
.
get
(),
resource
);
return
SurenessCommonUtil
.
attachContextPath
(
getContextPath
(),
resource
);
}
}
public
List
<
String
>
getScanPackages
()
{
public
List
<
String
>
getScanPackages
()
{
...
...
core/src/main/java/com/usthe/sureness/provider/ducument/DocumentPathTreeProvider.java
浏览文件 @
24936c5a
...
@@ -35,7 +35,7 @@ public class DocumentPathTreeProvider implements PathTreeProvider {
...
@@ -35,7 +35,7 @@ public class DocumentPathTreeProvider implements PathTreeProvider {
}
else
{
}
else
{
resourceSet
=
new
HashSet
<>();
resourceSet
=
new
HashSet
<>();
}
}
return
SurenessCommonUtil
.
attachContextPath
(
contextPathRef
.
get
(),
resourceSet
);
return
SurenessCommonUtil
.
attachContextPath
(
getContextPath
(),
resourceSet
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
logger
.
error
(
"load config data from yaml file error: "
,
e
);
logger
.
error
(
"load config data from yaml file error: "
,
e
);
throw
new
SurenessLoadDataException
(
e
.
getMessage
());
throw
new
SurenessLoadDataException
(
e
.
getMessage
());
...
@@ -55,7 +55,7 @@ public class DocumentPathTreeProvider implements PathTreeProvider {
...
@@ -55,7 +55,7 @@ public class DocumentPathTreeProvider implements PathTreeProvider {
}
else
{
}
else
{
resourceSet
=
new
HashSet
<>();
resourceSet
=
new
HashSet
<>();
}
}
return
SurenessCommonUtil
.
attachContextPath
(
contextPathRef
.
get
(),
resourceSet
);
return
SurenessCommonUtil
.
attachContextPath
(
getContextPath
(),
resourceSet
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
logger
.
error
(
"load config data from yaml file error: "
,
e
);
logger
.
error
(
"load config data from yaml file error: "
,
e
);
throw
new
SurenessLoadDataException
(
e
.
getMessage
());
throw
new
SurenessLoadDataException
(
e
.
getMessage
());
...
...
core/src/main/java/com/usthe/sureness/provider/ducument/DocumentResourceDefaultProvider.java
浏览文件 @
24936c5a
...
@@ -50,7 +50,7 @@ public class DocumentResourceDefaultProvider implements PathTreeProvider, Surene
...
@@ -50,7 +50,7 @@ public class DocumentResourceDefaultProvider implements PathTreeProvider, Surene
}
else
{
}
else
{
resourceSet
=
new
HashSet
<>();
resourceSet
=
new
HashSet
<>();
}
}
return
SurenessCommonUtil
.
attachContextPath
(
contextPathRef
.
get
(),
resourceSet
);
return
SurenessCommonUtil
.
attachContextPath
(
getContextPath
(),
resourceSet
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
logger
.
error
(
"load config data from yaml file error: "
,
e
);
logger
.
error
(
"load config data from yaml file error: "
,
e
);
throw
new
SurenessLoadDataException
(
e
.
getMessage
());
throw
new
SurenessLoadDataException
(
e
.
getMessage
());
...
@@ -70,7 +70,7 @@ public class DocumentResourceDefaultProvider implements PathTreeProvider, Surene
...
@@ -70,7 +70,7 @@ public class DocumentResourceDefaultProvider implements PathTreeProvider, Surene
}
else
{
}
else
{
resourceSet
=
new
HashSet
<>();
resourceSet
=
new
HashSet
<>();
}
}
return
SurenessCommonUtil
.
attachContextPath
(
contextPathRef
.
get
(),
resourceSet
);
return
SurenessCommonUtil
.
attachContextPath
(
getContextPath
(),
resourceSet
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
logger
.
error
(
"load config data from yaml file error: "
,
e
);
logger
.
error
(
"load config data from yaml file error: "
,
e
);
throw
new
SurenessLoadDataException
(
e
.
getMessage
());
throw
new
SurenessLoadDataException
(
e
.
getMessage
());
...
...
sample-tom/src/main/java/com/usthe/sureness/sample/tom/sureness/provider/DatabasePathTreeProvider.java
浏览文件 @
24936c5a
...
@@ -22,13 +22,13 @@ public class DatabasePathTreeProvider implements PathTreeProvider {
...
@@ -22,13 +22,13 @@ public class DatabasePathTreeProvider implements PathTreeProvider {
@Override
@Override
public
Set
<
String
>
providePathData
()
{
public
Set
<
String
>
providePathData
()
{
return
SurenessCommonUtil
.
attachContextPath
(
contextPathRef
.
get
(),
resourceService
.
getAllEnableResourcePath
());
return
SurenessCommonUtil
.
attachContextPath
(
getContextPath
(),
resourceService
.
getAllEnableResourcePath
());
}
}
@Override
@Override
public
Set
<
String
>
provideExcludedResource
()
{
public
Set
<
String
>
provideExcludedResource
()
{
return
SurenessCommonUtil
.
attachContextPath
(
contextPathRef
.
get
(),
resourceService
.
getAllDisableResourcePath
());
return
SurenessCommonUtil
.
attachContextPath
(
getContextPath
(),
resourceService
.
getAllDisableResourcePath
());
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录