Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Pig
提交
8e9aaafd
P
Pig
项目概览
int
/
Pig
上一次同步 大约 1 年
通知
8
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Pig
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8e9aaafd
编写于
11月 01, 2020
作者:
pig_冷冷
提交者:
Gitee
11月 01, 2020
浏览文件
操作
浏览文件
下载
差异文件
!80 up spring boot 2.3.5
Merge pull request !80 from lengleng/dev
上级
2f3fd1cb
7f1f31c2
变更
24
显示空白变更内容
内联
并排
Showing
24 changed file
with
72 addition
and
67 deletion
+72
-67
README.md
README.md
+3
-3
pig-auth/pom.xml
pig-auth/pom.xml
+4
-4
pig-common/pig-common-core/pom.xml
pig-common/pig-common-core/pom.xml
+1
-1
pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/mybatis/SqlFilterArgumentResolver.java
...ud/pig/common/core/mybatis/SqlFilterArgumentResolver.java
+36
-31
pig-common/pig-common-datasource/pom.xml
pig-common/pig-common-datasource/pom.xml
+1
-1
pig-common/pig-common-job/pom.xml
pig-common/pig-common-job/pom.xml
+1
-1
pig-common/pig-common-log/pom.xml
pig-common/pig-common-log/pom.xml
+3
-3
pig-common/pig-common-mybatis/pom.xml
pig-common/pig-common-mybatis/pom.xml
+1
-1
pig-common/pig-common-security/pom.xml
pig-common/pig-common-security/pom.xml
+3
-3
pig-common/pig-common-sentinel/pom.xml
pig-common/pig-common-sentinel/pom.xml
+2
-2
pig-common/pig-common-swagger/pom.xml
pig-common/pig-common-swagger/pom.xml
+1
-1
pig-common/pig-common-test/pom.xml
pig-common/pig-common-test/pom.xml
+2
-2
pig-common/pom.xml
pig-common/pom.xml
+1
-1
pig-gateway/pom.xml
pig-gateway/pom.xml
+1
-1
pig-register/pom.xml
pig-register/pom.xml
+1
-1
pig-upms/pig-upms-api/pom.xml
pig-upms/pig-upms-api/pom.xml
+1
-1
pig-upms/pig-upms-biz/pom.xml
pig-upms/pig-upms-biz/pom.xml
+1
-1
pig-upms/pom.xml
pig-upms/pom.xml
+1
-1
pig-visual/pig-codegen/pom.xml
pig-visual/pig-codegen/pom.xml
+1
-1
pig-visual/pig-monitor/pom.xml
pig-visual/pig-monitor/pom.xml
+1
-1
pig-visual/pig-sentinel-dashboard/pom.xml
pig-visual/pig-sentinel-dashboard/pom.xml
+1
-1
pig-visual/pig-xxl-job-admin/pom.xml
pig-visual/pig-xxl-job-admin/pom.xml
+1
-1
pig-visual/pom.xml
pig-visual/pom.xml
+1
-1
pom.xml
pom.xml
+3
-3
未找到文件。
README.md
浏览文件 @
8e9aaafd
...
...
@@ -18,12 +18,12 @@
| 依赖 | 版本 |
| ---------------------- | ------------- |
| Spring Boot | 2.3.
4
.RELEASE |
| Spring Boot | 2.3.
5
.RELEASE |
| Spring Cloud | Hoxton.SR8 |
| Spring Cloud Alibaba | 2.2.3.RELEASE |
| Spring Security OAuth2 | 2.3.6 |
| Mybatis Plus | 3.4.0 |
| hutool | 5.4.
4
|
| hutool | 5.4.
7
|
| Avue | 2.6.16 |
### 模块说明
...
...
@@ -99,7 +99,7 @@ mvn archetype:generate \
-Dpackage=com.pig4cloud.pig.demo \
-DarchetypeGroupId=com.pig4cloud.archetype \
-DarchetypeArtifactId=pig-gen \
-DarchetypeVersion=2.10.
0
\
-DarchetypeVersion=2.10.
1
\
-DarchetypeCatalog=local
```
...
...
pig-auth/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -21,7 +21,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-auth
</artifactId>
...
...
@@ -44,19 +44,19 @@
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-sentinel
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</dependency>
<!--upms api、model 模块-->
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-upms-api
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</dependency>
<!--security-->
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-security
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</dependency>
<!--JDBC相关-->
<dependency>
...
...
pig-common/pig-common-core/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -21,7 +21,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-common-core
</artifactId>
...
...
pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/mybatis/SqlFilterArgumentResolver.java
浏览文件 @
8e9aaafd
/*
* Copyright (c) 2020 pig4cloud Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* * Copyright (c) 2019-2020, 冷冷 (wangiegie@gmail.com).
* * <p>
* * Licensed under the GNU Lesser General Public License 3.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* * <p>
* * https://www.gnu.org/licenses/lgpl.html
* * <p>
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.pig4cloud.pig.common.core.mybatis
;
...
...
@@ -27,7 +29,11 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import
org.springframework.web.method.support.ModelAndViewContainer
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.function.Predicate
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -39,6 +45,9 @@ import java.util.stream.Collectors;
@Slf4j
public
class
SqlFilterArgumentResolver
implements
HandlerMethodArgumentResolver
{
private
final
static
String
[]
KEYWORDS
=
{
"master"
,
"truncate"
,
"insert"
,
"select"
,
"delete"
,
"update"
,
"declare"
,
"alter"
,
"drop"
,
"sleep"
};
/**
* 判断Controller是否包含page 参数
* @param parameter 参数
...
...
@@ -69,7 +78,7 @@ public class SqlFilterArgumentResolver implements HandlerMethodArgumentResolver
String
current
=
request
.
getParameter
(
"current"
);
String
size
=
request
.
getParameter
(
"size"
);
Page
<?>
page
=
new
Page
<>
();
Page
page
=
new
Page
();
if
(
StrUtil
.
isNotBlank
(
current
))
{
page
.
setCurrent
(
Long
.
parseLong
(
current
));
}
...
...
@@ -79,32 +88,28 @@ public class SqlFilterArgumentResolver implements HandlerMethodArgumentResolver
}
List
<
OrderItem
>
orderItemList
=
new
ArrayList
<>();
Optional
.
ofNullable
(
ascs
).
ifPresent
(
s
->
orderItemList
.
addAll
(
Arrays
.
stream
(
s
).
filter
(
StrUtil:
:
isNotBlank
)
.
map
(
this
::
clear
).
map
(
OrderItem:
:
asc
).
collect
(
Collectors
.
toList
())));
Optional
.
ofNullable
(
descs
).
ifPresent
(
s
->
orderItemList
.
addAll
(
Arrays
.
stream
(
s
).
filter
(
StrUtil:
:
isNotBlank
)
.
map
(
this
::
clear
).
map
(
OrderItem:
:
desc
).
collect
(
Collectors
.
toList
())));
Optional
.
ofNullable
(
ascs
).
ifPresent
(
s
->
orderItemList
.
addAll
(
Arrays
.
stream
(
s
).
filter
(
sqlInjectPredicate
()
).
map
(
OrderItem:
:
asc
).
collect
(
Collectors
.
toList
())));
Optional
.
ofNullable
(
descs
).
ifPresent
(
s
->
orderItemList
.
addAll
(
Arrays
.
stream
(
s
).
filter
(
sqlInjectPredicate
()
).
map
(
OrderItem:
:
desc
).
collect
(
Collectors
.
toList
())));
page
.
addOrder
(
orderItemList
);
return
page
;
}
/**
* 参数清理
* @param param 参数
* @return String
* 判断用户输入里面有没有关键字
* @return Predicate
*/
private
String
clear
(
String
param
)
{
if
(
StrUtil
.
isBlank
(
param
))
{
return
StrUtil
.
trim
(
param
);
}
StringBuilder
builder
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
param
.
length
();
i
++)
{
char
c
=
param
.
charAt
(
i
);
if
(
Character
.
isJavaIdentifierPart
(
c
))
{
builder
.
append
(
c
);
private
Predicate
<
String
>
sqlInjectPredicate
()
{
return
sql
->
{
for
(
String
keyword
:
KEYWORDS
)
{
if
(
StrUtil
.
containsIgnoreCase
(
sql
,
keyword
))
{
return
false
;
}
}
return
builder
.
toString
();
return
true
;
};
}
}
pig-common/pig-common-datasource/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -21,7 +21,7 @@
<parent>
<artifactId>
pig-common
</artifactId>
<groupId>
com.pig4cloud
</groupId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
pig-common/pig-common-job/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -23,7 +23,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-common-job
</artifactId>
...
...
pig-common/pig-common-log/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -21,7 +21,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-common-log
</artifactId>
...
...
@@ -35,13 +35,13 @@
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-core
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</dependency>
<!--UPMS接口模块-->
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-upms-api
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</dependency>
<!--安全依赖获取上下文信息-->
<dependency>
...
...
pig-common/pig-common-mybatis/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -21,7 +21,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-common-mybatis
</artifactId>
...
...
pig-common/pig-common-security/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -21,7 +21,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-common-security
</artifactId>
...
...
@@ -35,7 +35,7 @@
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-core
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</dependency>
<!--安全模块-->
<dependency>
...
...
@@ -50,7 +50,7 @@
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-upms-api
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</dependency>
</dependencies>
</project>
pig-common/pig-common-sentinel/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -21,7 +21,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
@@ -32,7 +32,7 @@
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-core
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</dependency>
<dependency>
<groupId>
com.alibaba.cloud
</groupId>
...
...
pig-common/pig-common-swagger/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -24,7 +24,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-common-swagger
</artifactId>
...
...
pig-common/pig-common-test/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -6,7 +6,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-common-test
</artifactId>
...
...
@@ -18,7 +18,7 @@
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-security
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</dependency>
<dependency>
<groupId>
org.springframework.security
</groupId>
...
...
pig-common/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -21,7 +21,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-common
</artifactId>
...
...
pig-gateway/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -21,7 +21,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-gateway
</artifactId>
...
...
pig-register/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -18,7 +18,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-register
</artifactId>
...
...
pig-upms/pig-upms-api/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -21,7 +21,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-upms
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-upms-api
</artifactId>
...
...
pig-upms/pig-upms-biz/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -21,7 +21,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-upms
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-upms-biz
</artifactId>
...
...
pig-upms/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -21,7 +21,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-upms
</artifactId>
...
...
pig-visual/pig-codegen/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -22,7 +22,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-visual
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-codegen
</artifactId>
...
...
pig-visual/pig-monitor/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -21,7 +21,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-visual
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-monitor
</artifactId>
...
...
pig-visual/pig-sentinel-dashboard/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -6,7 +6,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-visual
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-sentinel-dashboard
</artifactId>
...
...
pig-visual/pig-xxl-job-admin/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-visual
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-xxl-job-admin
</artifactId>
...
...
pig-visual/pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -21,7 +21,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
</parent>
<artifactId>
pig-visual
</artifactId>
...
...
pom.xml
浏览文件 @
8e9aaafd
...
...
@@ -28,20 +28,20 @@
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig
</artifactId>
<version>
2.10.
0
</version>
<version>
2.10.
1
</version>
<name>
${project.artifactId}
</name>
<packaging>
pom
</packaging>
<url>
https://www.pig4cloud.com
</url>
<properties>
<spring-boot.version>
2.3.
4
.RELEASE
</spring-boot.version>
<spring-boot.version>
2.3.
5
.RELEASE
</spring-boot.version>
<spring-cloud.version>
Hoxton.SR8
</spring-cloud.version>
<spring-cloud-alibaba.version>
2.2.3.RELEASE
</spring-cloud-alibaba.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven.compiler.source>
1.8
</maven.compiler.source>
<maven.compiler.target>
1.8
</maven.compiler.target>
<spring-boot-admin.version>
2.3.0
</spring-boot-admin.version>
<hutool.version>
5.4.
6
</hutool.version>
<hutool.version>
5.4.
7
</hutool.version>
<mybatis-plus.version>
3.4.0
</mybatis-plus.version>
<dynamic-ds.version>
3.2.0
</dynamic-ds.version>
<captcha.version>
2.2.0
</captcha.version>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录