Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
李小龙
/
rapidplatform-cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
72c20035
authored
Jan 04, 2026
by
xlx
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
新增mybatis模块
parent
52ba6026
Show whitespace changes
Inline
Side-by-side
Showing
88 changed files
with
901 additions
and
1111 deletions
matchtech-api/matchtech-api-system/pom.xml
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/RemoteUserService.java
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/domain/SysDept.java
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/domain/SysDictData.java
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/domain/SysDictType.java
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/domain/SysLogininfor.java
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/domain/SysOperLog.java
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/domain/SysRole.java
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/domain/SysUser.java
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/factory/RemoteUserFallbackFactory.java
matchtech-auth/matchtech-auth-idm/pom.xml
matchtech-auth/matchtech-auth-local/src/main/java/com/matchtech/matchtechauthlocal/controller/LocalLoginController.java
matchtech-common/matchtech-common-core/pom.xml
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/annotation/Excel.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/page/PageVO.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/page/result/ExcelErrorVo.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/page/result/ExcelImportVo.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/utils/PageUtils.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/utils/file/FileUtils.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/web/domain/TreeEntity.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/web/page/PageDomain.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/web/page/TableDataInfo.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/web/page/TableSupport.java
matchtech-common/matchtech-common-datascope/pom.xml
matchtech-common/matchtech-common-datascope/src/main/java/com/matchtech/common/datascope/aspect/DataScopeAspect.java
matchtech-common/matchtech-common-datasource/pom.xml
matchtech-common/matchtech-common-datasource/src/main/java/com/matchtech/common/datasource/config/MyBatisPlusConfig.java
matchtech-common/matchtech-common-dto/pom.xml
matchtech-common/matchtech-common-dto/src/main/java/com/matchtech/common/dto/constants/GlobalCodeMessageEnum.java
matchtech-common/matchtech-common-dto/src/main/java/com/matchtech/common/dto/constants/HttpStatus.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/page/PageParam.java → matchtech-common/matchtech-common-dto/src/main/java/com/matchtech/common/dto/page/PageParam.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/page/PageReqDto.java → matchtech-common/matchtech-common-dto/src/main/java/com/matchtech/common/dto/page/PageReqDto.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/page/PageResult.java → matchtech-common/matchtech-common-dto/src/main/java/com/matchtech/common/dto/page/PageResult.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/page/ReqDTO.java → matchtech-common/matchtech-common-dto/src/main/java/com/matchtech/common/dto/page/ReqDTO.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/page/SortingField.java → matchtech-common/matchtech-common-dto/src/main/java/com/matchtech/common/dto/page/SortingField.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/page/resp/ApiResponseEntity.java → matchtech-common/matchtech-common-dto/src/main/java/com/matchtech/common/dto/page/resp/ApiResponseEntity.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/page/resp/ApiResponseUtils.java → matchtech-common/matchtech-common-dto/src/main/java/com/matchtech/common/dto/page/resp/ApiResponseUtils.java
matchtech-common/matchtech-common-dto/src/main/java/com/matchtech/common/dto/web/AjaxResult.java
matchtech-common/matchtech-common-log/src/main/java/com/matchtech/common/log/aspect/LogAspect.java
matchtech-common/matchtech-common-mybatis/pom.xml
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/mybatis/BaseMapperX.java → matchtech-common/matchtech-common-mybatis/src/main/java/com/matchtech/common/mybatis/BaseMapperX.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/mybatis/LambdaQueryWrapperX.java → matchtech-common/matchtech-common-mybatis/src/main/java/com/matchtech/common/mybatis/LambdaQueryWrapperX.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/mybatis/MyBatisUtils.java → matchtech-common/matchtech-common-mybatis/src/main/java/com/matchtech/common/mybatis/MyBatisUtils.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/mybatis/QueryCondition.java → matchtech-common/matchtech-common-mybatis/src/main/java/com/matchtech/common/mybatis/QueryCondition.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/mybatis/QueryConditionEnum.java → matchtech-common/matchtech-common-mybatis/src/main/java/com/matchtech/common/mybatis/QueryConditionEnum.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/mybatis/QueryWrapperX.java → matchtech-common/matchtech-common-mybatis/src/main/java/com/matchtech/common/mybatis/QueryWrapperX.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/domain/BaseEntity.java → matchtech-common/matchtech-common-mybatis/src/main/java/com/matchtech/common/mybatis/domain/BaseEntity.java
matchtech-common/matchtech-common-mybatis/src/main/java/com/matchtech/common/mybatis/utils/PageUtil.java
matchtech-common/matchtech-common-mybatis/src/main/resources/application.properties
matchtech-common/matchtech-common-security/pom.xml
matchtech-common/matchtech-common-security/src/main/java/com/matchtech/common/security/aspect/InnerAuthAspect.java
matchtech-common/matchtech-common-security/src/main/java/com/matchtech/common/security/feign/FeignRequestInterceptor.java
matchtech-common/matchtech-common-security/src/main/java/com/matchtech/common/security/interceptor/HeaderInterceptor.java
matchtech-common/matchtech-common-security/src/main/java/com/matchtech/common/security/service/TokenService.java
matchtech-common/matchtech-common-security/src/main/java/com/matchtech/common/security/utils/SecurityUtils.java
matchtech-common/matchtech-common-servlet/pom.xml
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/utils/poi/ExcelHandlerAdapter.java → matchtech-common/matchtech-common-servlet/src/main/java/com/matchtech/common/servlet/poi/ExcelHandlerAdapter.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/utils/poi/ExcelUtil.java → matchtech-common/matchtech-common-servlet/src/main/java/com/matchtech/common/servlet/poi/ExcelUtil.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/servlet/MyHttpServletRequestWrapper.java → matchtech-common/matchtech-common-servlet/src/main/java/com/matchtech/common/servlet/servlet/MyHttpServletRequestWrapper.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/servlet/MyHttpServletResponseWrapper.java → matchtech-common/matchtech-common-servlet/src/main/java/com/matchtech/common/servlet/servlet/MyHttpServletResponseWrapper.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/servlet/RequestReadUtils.java → matchtech-common/matchtech-common-servlet/src/main/java/com/matchtech/common/servlet/servlet/RequestReadUtils.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/utils/ServletUtils.java → matchtech-common/matchtech-common-servlet/src/main/java/com/matchtech/common/servlet/utils/ServletUtils.java
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/utils/ip/IpUtils.java → matchtech-common/matchtech-common-servlet/src/main/java/com/matchtech/common/servlet/utils/ip/IpUtils.java
matchtech-common/matchtech-common-servlet/src/main/resources/application.properties
matchtech-common/matchtech-common-swagger/pom.xml
matchtech-common/matchtech-common-swagger/src/main/java/com/matchtech/common/swagger/config/SpringDocAutoConfiguration.java
matchtech-common/matchtech-common-swagger/src/main/java/com/matchtech/common/swagger/config/properties/SpringDocProperties.java
matchtech-common/matchtech-common-swagger/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
matchtech-common/pom.xml
matchtech-gateway/pom.xml
matchtech-gateway/src/main/java/com/matchtech/gateway/filter/AuthFilter.java
matchtech-gateway/src/main/java/com/matchtech/gateway/filter/BlackListUrlFilter.java
matchtech-gateway/src/main/java/com/matchtech/gateway/filter/ValidateCodeFilter.java
matchtech-gateway/src/main/java/com/matchtech/gateway/handler/GatewayExceptionHandler.java
matchtech-gateway/src/main/java/com/matchtech/gateway/handler/SentinelFallbackHandler.java
matchtech-gateway/src/main/java/com/matchtech/gateway/service/impl/ValidateCodeServiceImpl.java
matchtech-gateway/src/main/java/com/matchtech/gateway/utils/WebFluxUtil.java
matchtech-modules/matchtech-modules-job/pom.xml
matchtech-modules/matchtech-modules-job/src/main/java/com/matchtech/job/domain/SysJob.java
matchtech-modules/matchtech-modules-job/src/main/java/com/matchtech/job/domain/SysJobLog.java
matchtech-modules/matchtech-modules-system/pom.xml
matchtech-modules/matchtech-modules-system/src/main/java/com/matchtech/system/controller/SysUserController.java
matchtech-modules/matchtech-modules-system/src/main/java/com/matchtech/system/entity/SysUserEntity.java
matchtech-modules/matchtech-modules-system/src/main/java/com/matchtech/system/mapper/SysEmployeeMapper.java
matchtech-modules/matchtech-modules-system/src/main/java/com/matchtech/system/mapper/SysUserMapper.java
matchtech-modules/matchtech-modules-system/src/main/java/com/matchtech/system/service/SysUserService.java
matchtech-modules/matchtech-modules-system/src/main/resources/bootstrap.yml
pom.xml
matchtech-api/matchtech-api-system/pom.xml
View file @
72c20035
...
...
@@ -22,6 +22,12 @@
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-core
</artifactId>
</dependency>
<dependency>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-mybatis
</artifactId>
<version>
3.1.1
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
...
...
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/RemoteUserService.java
View file @
72c20035
...
...
@@ -2,17 +2,12 @@ package com.matchtech.system.api;
import
com.matchtech.common.core.constants.SecurityConstants
;
import
com.matchtech.common.core.constants.ServiceNameConstants
;
import
com.matchtech.common.core.domain.R
;
import
com.matchtech.common.core.page.resp.ApiResponseEntity
;
import
com.matchtech.system.api.domain.SysUser
;
import
com.matchtech.common.dto.page.resp.ApiResponseEntity
;
import
com.matchtech.system.api.factory.RemoteUserFallbackFactory
;
import
com.matchtech.system.api.model.LoginUser
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestHeader
;
/**
...
...
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/domain/SysDept.java
View file @
72c20035
...
...
@@ -3,7 +3,7 @@ package com.matchtech.system.api.domain;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.matchtech.common.
core
.domain.BaseEntity
;
import
com.matchtech.common.
mybatis
.domain.BaseEntity
;
import
jakarta.validation.constraints.Email
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.NotNull
;
...
...
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/domain/SysDictData.java
View file @
72c20035
package
com
.
matchtech
.
system
.
api
.
domain
;
import
com.matchtech.common.
core
.domain.BaseEntity
;
import
com.matchtech.common.
mybatis
.domain.BaseEntity
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.Size
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
...
...
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/domain/SysDictType.java
View file @
72c20035
package
com
.
matchtech
.
system
.
api
.
domain
;
import
com.matchtech.common.
core
.domain.BaseEntity
;
import
com.matchtech.common.
mybatis
.domain.BaseEntity
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.Pattern
;
import
jakarta.validation.constraints.Size
;
...
...
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/domain/SysLogininfor.java
View file @
72c20035
...
...
@@ -4,7 +4,7 @@ import java.util.Date;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.matchtech.common.core.annotation.Excel
;
import
com.matchtech.common.core.annotation.Excel.ColumnType
;
import
com.matchtech.common.
core
.domain.BaseEntity
;
import
com.matchtech.common.
mybatis
.domain.BaseEntity
;
/**
* 系统访问记录表 sys_logininfor
...
...
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/domain/SysOperLog.java
View file @
72c20035
...
...
@@ -4,7 +4,7 @@ import java.util.Date;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.matchtech.common.core.annotation.Excel
;
import
com.matchtech.common.core.annotation.Excel.ColumnType
;
import
com.matchtech.common.
core
.domain.BaseEntity
;
import
com.matchtech.common.
mybatis
.domain.BaseEntity
;
/**
* 操作日志记录表 oper_log
...
...
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/domain/SysRole.java
View file @
72c20035
package
com
.
matchtech
.
system
.
api
.
domain
;
import
java.util.Set
;
import
com.matchtech.common.
core
.domain.BaseEntity
;
import
com.matchtech.common.core.annotation.Excel
;
import
com.matchtech.common.core.annotation.Excel.ColumnType
;
import
com.matchtech.common.
mybatis
.domain.BaseEntity
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.NotNull
;
import
jakarta.validation.constraints.Size
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.matchtech.common.core.annotation.Excel
;
import
com.matchtech.common.core.annotation.Excel.ColumnType
;
import
java.util.Set
;
/**
* 角色表 sys_role
...
...
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/domain/SysUser.java
View file @
72c20035
...
...
@@ -5,7 +5,7 @@ import com.matchtech.common.core.annotation.Excel.ColumnType;
import
com.matchtech.common.core.annotation.Excel.Type
;
import
com.matchtech.common.core.annotation.Excels
;
import
com.matchtech.common.core.constants.UserConstants
;
import
com.matchtech.common.
core
.domain.BaseEntity
;
import
com.matchtech.common.
mybatis
.domain.BaseEntity
;
import
lombok.Data
;
import
java.util.Date
;
...
...
matchtech-api/matchtech-api-system/src/main/java/com/matchtech/system/api/factory/RemoteUserFallbackFactory.java
View file @
72c20035
package
com
.
matchtech
.
system
.
api
.
factory
;
import
com.matchtech.common.core.domain.R
;
import
com.matchtech.common.core.page.resp.ApiResponseEntity
;
import
com.matchtech.common.dto.page.resp.ApiResponseEntity
;
import
com.matchtech.system.api.RemoteUserService
;
import
com.matchtech.system.api.domain.SysUser
;
import
com.matchtech.system.api.model.LoginUser
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
matchtech-auth/matchtech-auth-idm/pom.xml
View file @
72c20035
...
...
@@ -55,9 +55,11 @@
<!-- matchtech Common Swagger -->
<dependency>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-swagger
</artifactId>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-openapi3-jakarta-spring-boot-starter
</artifactId>
<version>
4.3.0
</version>
</dependency>
</dependencies>
<build>
...
...
matchtech-auth/matchtech-auth-local/src/main/java/com/matchtech/matchtechauthlocal/controller/LocalLoginController.java
View file @
72c20035
package
com
.
matchtech
.
matchtechauthlocal
.
controller
;
import
com.matchtech.common.core.constants.SecurityConstants
;
import
com.matchtech.common.
core
.page.resp.ApiResponseEntity
;
import
com.matchtech.common.
core
.page.resp.ApiResponseUtils
;
import
com.matchtech.common.
dto
.page.resp.ApiResponseEntity
;
import
com.matchtech.common.
dto
.page.resp.ApiResponseUtils
;
import
com.matchtech.common.core.web.controller.BaseController
;
import
com.matchtech.common.dto.login.SysLoginDto
;
import
com.matchtech.common.dto.login.SysLoginVo
;
import
com.matchtech.common.dto.login.TokenDto
;
import
com.matchtech.common.redis.constant.RedisConstants
;
import
com.matchtech.common.redis.service.RedisUtils
;
...
...
@@ -22,8 +21,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Map
;
@Tag
(
name
=
"系统登录"
)
@RestController
@RequestMapping
(
value
=
"a/sys/"
)
...
...
matchtech-common/matchtech-common-core/pom.xml
View file @
72c20035
...
...
@@ -35,12 +35,6 @@
<artifactId>
spring-context-support
</artifactId>
</dependency>
<!-- Spring Web -->
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-web
</artifactId>
</dependency>
<!-- Transmittable ThreadLocal -->
<dependency>
<groupId>
com.alibaba
</groupId>
...
...
@@ -53,26 +47,6 @@
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-extension
</artifactId>
</dependency>
<!-- MyBatis 测试 -->
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter-test
</artifactId>
<version>
3.0.2
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
com.oracle.database.jdbc
</groupId>
<artifactId>
ojdbc11
</artifactId>
...
...
@@ -133,12 +107,6 @@
<artifactId>
poi-ooxml
</artifactId>
</dependency>
<!-- Java Servlet -->
<dependency>
<groupId>
jakarta.servlet
</groupId>
<artifactId>
jakarta.servlet-api
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
...
...
@@ -150,8 +118,9 @@
</dependency>
<dependency>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-swagger
</artifactId>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-openapi3-jakarta-spring-boot-starter
</artifactId>
<version>
4.3.0
</version>
</dependency>
<dependency>
...
...
@@ -170,6 +139,16 @@
<version>
${mapstruct.version}
</version>
</dependency>
<dependency>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-dto
</artifactId>
</dependency>
</dependencies>
<!-- matchtech-common-core中的spring-web依赖(第31行)-->
<!-- matchtech-common-core中的jakarta.servlet-api依赖(第121行)-->
<!-- matchtech-common-core中的mybatis-plus-boot-starter等依赖(第49-57行)-->
</project>
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/annotation/Excel.java
View file @
72c20035
...
...
@@ -7,7 +7,6 @@ import java.lang.annotation.Target;
import
java.math.BigDecimal
;
import
org.apache.poi.ss.usermodel.HorizontalAlignment
;
import
org.apache.poi.ss.usermodel.IndexedColors
;
import
com.matchtech.common.core.utils.poi.ExcelHandlerAdapter
;
/**
* 自定义导出Excel数据注解
...
...
@@ -140,11 +139,6 @@ public @interface Excel
public
HorizontalAlignment
align
()
default
HorizontalAlignment
.
CENTER
;
/**
* 自定义数据处理器
*/
public
Class
<?>
handler
()
default
ExcelHandlerAdapter
.
class
;
/**
* 自定义数据处理器参数
*/
public
String
[]
args
()
default
{};
...
...
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/page/PageVO.java
deleted
100644 → 0
View file @
52ba6026
package
com
.
matchtech
.
common
.
core
.
page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
@Schema
(
description
=
"分页响应VO"
)
public
class
PageVO
<
T
>
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
5165369386930215118L
;
@Schema
(
description
=
"返回数据"
)
private
List
<
T
>
list
;
@Schema
(
description
=
"总条数"
)
private
Long
count
;
@Schema
(
description
=
"当前页"
)
private
Integer
pageNo
;
@Schema
(
description
=
"总页数"
)
private
Integer
pages
;
@Schema
(
description
=
"每页条数"
)
private
Integer
pageSize
;
public
PageVO
(
List
<
T
>
list
,
Long
count
,
Integer
pageNo
,
Integer
pages
,
Integer
pageSize
)
{
this
.
list
=
list
;
this
.
count
=
count
;
this
.
pageNo
=
pageNo
;
this
.
pageSize
=
pageSize
;
this
.
pages
=
pages
;
}
public
PageVO
(
Page
<?>
page
,
List
<
T
>
list
)
{
this
.
list
=
list
;
this
.
count
=
page
.
getTotal
();
this
.
pageNo
=
(
int
)
page
.
getCurrent
();
this
.
pageSize
=
(
int
)
page
.
getSize
();
this
.
pages
=
(
int
)
page
.
getPages
();
}
public
static
<
T
>
PageVO
<
T
>
getPage
(
Page
<
T
>
pages
)
{
PageVO
<
T
>
data
=
new
PageVO
<>();
data
.
setList
(
pages
.
getRecords
());
data
.
setCount
(
pages
.
getTotal
());
data
.
setPageNo
((
int
)
pages
.
getCurrent
());
data
.
setPages
((
int
)
pages
.
getPages
());
data
.
setPageSize
((
int
)
pages
.
getSize
());
return
data
;
}
public
static
<
T
>
PageVO
<
T
>
getPage
(
Page
<?>
pages
,
List
<
T
>
list
)
{
PageVO
<
T
>
data
=
new
PageVO
<>();
data
.
setList
(
list
);
data
.
setCount
(
pages
.
getTotal
());
data
.
setPageNo
((
int
)
pages
.
getCurrent
());
data
.
setPages
((
int
)
pages
.
getPages
());
data
.
setPageSize
((
int
)
pages
.
getSize
());
return
data
;
}
public
PageVO
()
{
}
}
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/page/result/ExcelErrorVo.java
deleted
100644 → 0
View file @
52ba6026
package
com
.
matchtech
.
common
.
core
.
page
.
result
;
import
com.matchtech.common.core.utils.LocaleUtil
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
org.apache.commons.lang3.StringUtils
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.Map
;
@Data
@Schema
(
description
=
"excel导入错误信息VO"
)
public
class
ExcelErrorVo
implements
Serializable
{
@Schema
(
description
=
"行数"
)
private
Integer
row
;
@Schema
(
description
=
"标题"
)
private
String
title
;
@Schema
(
description
=
"错误信息"
)
private
String
msg
;
public
ExcelErrorVo
(
Integer
row
,
String
title
,
String
msg
)
{
this
.
row
=
row
;
this
.
title
=
title
;
this
.
msg
=
LocaleUtil
.
getMessage
(
msg
);
}
public
ExcelErrorVo
()
{
}
public
static
void
isNotNull
(
String
value
,
List
<
ExcelErrorVo
>
errorVoList
,
int
i
,
String
title
)
{
if
(
StringUtils
.
isBlank
(
value
))
{
errorVoList
.
add
(
new
ExcelErrorVo
(
i
,
title
,
"数据不为空"
));
}
}
public
static
void
notExists
(
String
value
,
List
<
ExcelErrorVo
>
errorVoList
,
int
i
,
String
title
)
{
if
(
StringUtils
.
isBlank
(
value
))
{
errorVoList
.
add
(
new
ExcelErrorVo
(
i
,
title
,
"数据库数据不存在"
));
}
}
public
static
void
exists
(
Map
<
String
,
String
>
emailMap
,
String
key
,
List
<
ExcelErrorVo
>
errorVoList
,
int
i
,
String
title
)
{
if
(
StringUtils
.
isBlank
(
key
))
{
return
;
}
String
value
=
emailMap
.
get
(
key
);
if
(
StringUtils
.
isNotBlank
(
value
))
{
errorVoList
.
add
(
new
ExcelErrorVo
(
i
,
title
,
"数据重复"
));
}
else
{
emailMap
.
put
(
key
,
"system"
);
}
}
}
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/page/result/ExcelImportVo.java
deleted
100644 → 0
View file @
52ba6026
package
com
.
matchtech
.
common
.
core
.
page
.
result
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
@Schema
(
description
=
"excel导入VO"
)
public
class
ExcelImportVo
implements
Serializable
{
@Schema
(
description
=
"错误信息导入"
)
private
String
message
;
@Schema
(
description
=
"总条数"
)
private
Integer
totalCount
;
@Schema
(
description
=
"错误条数"
)
private
Integer
errorCount
;
@Schema
(
description
=
"成功条数"
)
private
Integer
successCount
;
@Schema
(
description
=
"错误信息"
)
private
List
<?>
list
;
@Schema
(
description
=
"成功返回的信息"
)
private
List
<?>
successList
;
}
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/utils/PageUtils.java
deleted
100644 → 0
View file @
52ba6026
package
com
.
matchtech
.
common
.
core
.
utils
;
import
com.github.pagehelper.PageHelper
;
import
com.matchtech.common.core.utils.sql.SqlUtil
;
import
com.matchtech.common.core.web.page.PageDomain
;
import
com.matchtech.common.core.web.page.TableSupport
;
/**
* 分页工具类
*
* @author matchtech
*/
public
class
PageUtils
extends
PageHelper
{
/**
* 设置请求分页数据
*/
public
static
void
startPage
()
{
PageDomain
pageDomain
=
TableSupport
.
buildPageRequest
();
Integer
pageNum
=
pageDomain
.
getPageNum
();
Integer
pageSize
=
pageDomain
.
getPageSize
();
String
orderBy
=
SqlUtil
.
escapeOrderBySql
(
pageDomain
.
getOrderBy
());
Boolean
reasonable
=
pageDomain
.
getReasonable
();
PageHelper
.
startPage
(
pageNum
,
pageSize
,
orderBy
).
setReasonable
(
reasonable
);
}
/**
* 清理分页的线程变量
*/
public
static
void
clearPage
()
{
PageHelper
.
clearPage
();
}
}
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/utils/file/FileUtils.java
View file @
72c20035
...
...
@@ -8,8 +8,6 @@ import java.io.OutputStream;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
jakarta.servlet.http.HttpServletRequest
;
import
jakarta.servlet.http.HttpServletResponse
;
import
org.apache.commons.lang3.ArrayUtils
;
import
com.matchtech.common.core.utils.StringUtils
;
...
...
@@ -131,41 +129,6 @@ public class FileUtils
}
/**
* 下载文件名重新编码
*
* @param request 请求对象
* @param fileName 文件名
* @return 编码后的文件名
*/
public
static
String
setFileDownloadHeader
(
HttpServletRequest
request
,
String
fileName
)
throws
UnsupportedEncodingException
{
final
String
agent
=
request
.
getHeader
(
"USER-AGENT"
);
String
filename
=
fileName
;
if
(
agent
.
contains
(
"MSIE"
))
{
// IE浏览器
filename
=
URLEncoder
.
encode
(
filename
,
"utf-8"
);
filename
=
filename
.
replace
(
"+"
,
" "
);
}
else
if
(
agent
.
contains
(
"Firefox"
))
{
// 火狐浏览器
filename
=
new
String
(
fileName
.
getBytes
(),
"ISO8859-1"
);
}
else
if
(
agent
.
contains
(
"Chrome"
))
{
// google浏览器
filename
=
URLEncoder
.
encode
(
filename
,
"utf-8"
);
}
else
{
// 其它浏览器
filename
=
URLEncoder
.
encode
(
filename
,
"utf-8"
);
}
return
filename
;
}
/**
* 返回文件名
*
* @param filePath 文件
...
...
@@ -223,21 +186,7 @@ public class FileUtils
* @param realFileName 真实文件名
* @return
*/
public
static
void
setAttachmentResponseHeader
(
HttpServletResponse
response
,
String
realFileName
)
throws
UnsupportedEncodingException
{
String
percentEncodedFileName
=
percentEncode
(
realFileName
);
StringBuilder
contentDispositionValue
=
new
StringBuilder
();
contentDispositionValue
.
append
(
"attachment; filename="
)
.
append
(
percentEncodedFileName
)
.
append
(
";"
)
.
append
(
"filename*="
)
.
append
(
"utf-8''"
)
.
append
(
percentEncodedFileName
);
response
.
setHeader
(
"Content-disposition"
,
contentDispositionValue
.
toString
());
response
.
setHeader
(
"download-filename"
,
percentEncodedFileName
);
}
/**
* 百分号编码工具方法
...
...
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/web/domain/TreeEntity.java
deleted
100644 → 0
View file @
52ba6026
package
com
.
matchtech
.
common
.
core
.
web
.
domain
;
import
com.matchtech.common.core.domain.BaseEntity
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* Tree基类
*
* @author matchtech
*/
public
class
TreeEntity
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** 父菜单名称 */
private
String
parentName
;
/** 父菜单ID */
private
Long
parentId
;
/** 显示顺序 */
private
Integer
orderNum
;
/** 祖级列表 */
private
String
ancestors
;
/** 子部门 */
private
List
<?>
children
=
new
ArrayList
<>();
public
String
getParentName
()
{
return
parentName
;
}
public
void
setParentName
(
String
parentName
)
{
this
.
parentName
=
parentName
;
}
public
Long
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
Long
parentId
)
{
this
.
parentId
=
parentId
;
}
public
Integer
getOrderNum
()
{
return
orderNum
;
}
public
void
setOrderNum
(
Integer
orderNum
)
{
this
.
orderNum
=
orderNum
;
}
public
String
getAncestors
()
{
return
ancestors
;
}
public
void
setAncestors
(
String
ancestors
)
{
this
.
ancestors
=
ancestors
;
}
public
List
<?>
getChildren
()
{
return
children
;
}
public
void
setChildren
(
List
<?>
children
)
{
this
.
children
=
children
;
}
}
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/web/page/PageDomain.java
deleted
100644 → 0
View file @
52ba6026
package
com
.
matchtech
.
common
.
core
.
web
.
page
;
import
com.matchtech.common.core.utils.StringUtils
;
/**
* 分页数据
*
* @author matchtech
*/
public
class
PageDomain
{
/** 当前记录起始索引 */
private
Integer
pageNum
;
/** 每页显示记录数 */
private
Integer
pageSize
;
/** 排序列 */
private
String
orderByColumn
;
/** 排序的方向desc或者asc */
private
String
isAsc
=
"asc"
;
/** 分页参数合理化 */
private
Boolean
reasonable
=
true
;
public
String
getOrderBy
()
{
if
(
StringUtils
.
isEmpty
(
orderByColumn
))
{
return
""
;
}
return
StringUtils
.
toUnderScoreCase
(
orderByColumn
)
+
" "
+
isAsc
;
}
public
Integer
getPageNum
()
{
return
pageNum
;
}
public
void
setPageNum
(
Integer
pageNum
)
{
this
.
pageNum
=
pageNum
;
}
public
Integer
getPageSize
()
{
return
pageSize
;
}
public
void
setPageSize
(
Integer
pageSize
)
{
this
.
pageSize
=
pageSize
;
}
public
String
getOrderByColumn
()
{
return
orderByColumn
;
}
public
void
setOrderByColumn
(
String
orderByColumn
)
{
this
.
orderByColumn
=
orderByColumn
;
}
public
String
getIsAsc
()
{
return
isAsc
;
}
public
void
setIsAsc
(
String
isAsc
)
{
if
(
StringUtils
.
isNotEmpty
(
isAsc
))
{
// 兼容前端排序类型
if
(
"ascending"
.
equals
(
isAsc
))
{
isAsc
=
"asc"
;
}
else
if
(
"descending"
.
equals
(
isAsc
))
{
isAsc
=
"desc"
;
}
this
.
isAsc
=
isAsc
;
}
}
public
Boolean
getReasonable
()
{
if
(
StringUtils
.
isNull
(
reasonable
))
{
return
Boolean
.
TRUE
;
}
return
reasonable
;
}
public
void
setReasonable
(
Boolean
reasonable
)
{
this
.
reasonable
=
reasonable
;
}
}
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/web/page/TableDataInfo.java
deleted
100644 → 0
View file @
52ba6026
package
com
.
matchtech
.
common
.
core
.
web
.
page
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 表格分页数据对象
*
* @author matchtech
*/
public
class
TableDataInfo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/** 总记录数 */
private
long
total
;
/** 列表数据 */
private
List
<?>
rows
;
/** 消息状态码 */
private
int
code
;
/** 消息内容 */
private
String
msg
;
/**
* 表格数据对象
*/
public
TableDataInfo
()
{
}
/**
* 分页
*
* @param list 列表数据
* @param total 总记录数
*/
public
TableDataInfo
(
List
<?>
list
,
long
total
)
{
this
.
rows
=
list
;
this
.
total
=
total
;
}
public
long
getTotal
()
{
return
total
;
}
public
void
setTotal
(
long
total
)
{
this
.
total
=
total
;
}
public
List
<?>
getRows
()
{
return
rows
;
}
public
void
setRows
(
List
<?>
rows
)
{
this
.
rows
=
rows
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
public
String
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
}
\ No newline at end of file
matchtech-common/matchtech-common-core/src/main/java/com/matchtech/common/core/web/page/TableSupport.java
deleted
100644 → 0
View file @
52ba6026
package
com
.
matchtech
.
common
.
core
.
web
.
page
;
import
com.matchtech.common.core.text.Convert
;
import
com.matchtech.common.core.utils.ServletUtils
;
/**
* 表格数据处理
*
* @author matchtech
*/
public
class
TableSupport
{
/**
* 当前记录起始索引
*/
public
static
final
String
PAGE_NUM
=
"pageNum"
;
/**
* 每页显示记录数
*/
public
static
final
String
PAGE_SIZE
=
"pageSize"
;
/**
* 排序列
*/
public
static
final
String
ORDER_BY_COLUMN
=
"orderByColumn"
;
/**
* 排序的方向 "desc" 或者 "asc".
*/
public
static
final
String
IS_ASC
=
"isAsc"
;
/**
* 分页参数合理化
*/
public
static
final
String
REASONABLE
=
"reasonable"
;
/**
* 封装分页对象
*/
public
static
PageDomain
getPageDomain
()
{
PageDomain
pageDomain
=
new
PageDomain
();
pageDomain
.
setPageNum
(
Convert
.
toInt
(
ServletUtils
.
getParameter
(
PAGE_NUM
),
1
));
pageDomain
.
setPageSize
(
Convert
.
toInt
(
ServletUtils
.
getParameter
(
PAGE_SIZE
),
10
));
pageDomain
.
setOrderByColumn
(
ServletUtils
.
getParameter
(
ORDER_BY_COLUMN
));
pageDomain
.
setIsAsc
(
ServletUtils
.
getParameter
(
IS_ASC
));
pageDomain
.
setReasonable
(
ServletUtils
.
getParameterToBool
(
REASONABLE
));
return
pageDomain
;
}
public
static
PageDomain
buildPageRequest
()
{
return
getPageDomain
();
}
}
matchtech-common/matchtech-common-datascope/pom.xml
View file @
72c20035
...
...
@@ -22,6 +22,12 @@
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-security
</artifactId>
</dependency>
<dependency>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-mybatis
</artifactId>
<version>
3.1.1
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
matchtech-common/matchtech-common-datascope/src/main/java/com/matchtech/common/datascope/aspect/DataScopeAspect.java
View file @
72c20035
...
...
@@ -3,7 +3,7 @@ package com.matchtech.common.datascope.aspect;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.matchtech.common.
core
.domain.BaseEntity
;
import
com.matchtech.common.
mybatis
.domain.BaseEntity
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Before
;
...
...
matchtech-common/matchtech-common-datasource/pom.xml
View file @
72c20035
...
...
@@ -36,5 +36,11 @@
<artifactId>
matchtech-common-core
</artifactId>
</dependency>
<dependency>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-mybatis
</artifactId>
<version>
3.1.1
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
matchtech-common/matchtech-common-datasource/src/main/java/com/matchtech/common/datasource/config/MyBatisPlusConfig.java
View file @
72c20035
package
com
.
matchtech
.
common
.
datasource
.
config
;
import
com.baomidou.mybatisplus.annotation.DbType
;
import
com.baomidou.mybatisplus.core.handlers.MetaObjectHandler
;
import
com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
;
import
org.apache.ibatis.reflection.MetaObject
;
...
...
matchtech-common/matchtech-common-dto/pom.xml
View file @
72c20035
...
...
@@ -17,15 +17,22 @@
<dependencies>
<dependency>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-swagger
</artifactId>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-openapi3-jakarta-spring-boot-starter
</artifactId>
<version>
4.3.0
</version>
</dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
</dependency>
<dependency>
<groupId>
com.alibaba.fastjson2
</groupId>
<artifactId>
fastjson2
</artifactId>
</dependency>
</dependencies>
...
...
matchtech-common/matchtech-common-dto/src/main/java/com/matchtech/common/dto/constants/GlobalCodeMessageEnum.java
0 → 100644
View file @
72c20035
package
com
.
matchtech
.
common
.
dto
.
constants
;
/**
* 信息编号常量
*
* @author chenyingyi 信息类型: info, error, warning, notice 格式: validation + 信息类型 +
* 模块 + 信息 请按模块区分 例如VALIDATION_ERROR_EXCEPTION
*/
public
enum
GlobalCodeMessageEnum
{
/**
* 系统业务编码 100 - 999编码
*/
// 系统编码
// 成功
SUCCESS
(
200
,
"success"
),
//部分外部接口响应需要返回0
SUCCESS2
(
0
,
"success"
),
// 未知异常
SYSTEM_ERROR_EXCEPTION
(
500
,
"system.error.exception"
),
// 请求方法不对
SYSTEM_ERROR_NOT_ALLOWED
(
405
,
"请求方法不对,请检查请求方法(post,get等)"
),
// 未找到
SYSTEM_ERROR_NOT_FOUND
(
404
,
"请求地址不存在,请检查请求链接"
),
// 无权限访问
SYSTEM_ERROR_NOT_AUTH
(
403
,
"无权限访问"
),
// token错误
SYSTEM_ERROR_TOKEN
(
101
,
"system.error.token"
),
// 签名错误
SYSTEM_ERROR_SIGN
(
102
,
"system.error.sign"
),
// 解密错误
SYSTEM_ERROR_DECRYPT
(
103
,
"system.error.decrypt"
),
// 空指针
SYSTEM_ERROR_NULLPOINTER
(
104
,
"未找到数据"
),
// 非法参数
SYSTEM_ERROR_ILLEGAL_ARGUMENT
(
105
,
"非法参数,请检查参数"
),
// 参数类型不匹配
SYSTEM_ERROR_TYPE_MISMATCH
(
106
,
"参数类型不匹配"
),
// 请求参数缺失
SYSTEM_ERROR_MISSING_SERVLET_REQUEST_PARAMETER
(
107
,
"请求参数缺失,必填参数不能为空"
),
//body传参异常
SYSTEM_ERROR_BODY_MISMATCH
(
108
,
"body参数异常,采用body传参,格式json"
),
SYSTEM_ERROR_FILEURL
(
109
,
"本地存储不支持获取下载路径"
),
SYSTEM_USER_NOT_FOUND
(
110
,
"用户未找到"
),
SYSTEM_USER_LOGIN_NAME_EXISTS
(
111
,
"登录名已存在"
),
SYSTEM_TOKEN_NOT_FOUND
(
112
,
"token不能为空"
),
SYSTEM_TOKEN_OVERDUE
(
113
,
"token已失效,请重新登录"
),
SYSTEM_CONNECT_TIME_OUT
(
114
,
"第三方接口超时"
),
SYS_USERNAME_OR_PASSWORD_ERROR
(
115
,
"用户名或密码错误"
),
SYS_USER_LOGIN_FORBIDDEN
(
116
,
"该用户已被禁止登录"
),
SYS_USER_OLD_PASSWORD_ERROR
(
117
,
"旧密码错误"
),
SYS_USER_LOCKED
(
118
,
"该用户已被锁定,请稍后再试"
),
SYS_USER_INCORRECT_CAPTCHA
(
119
,
"验证码错误"
),
SYSTEM_ROLE_NOT_FOUND
(
130
,
"角色不存在"
),
SYSTEM_ROLE_LOGIN_NAME_EXISTS
(
131
,
"角色名称已存在"
),
SYSTEM_ROLE_IS_SYSTEM_DATA
(
132
,
"越权操作,该角色为系统数据"
),
SYSTEM_OFFICE_NOT_FOUND
(
150
,
"机构不存在"
),
SYSTEM_OFFICE_PARENT_NOT_FOUND
(
151
,
"父级机构不存在"
),
SYSTEM_OFFICE_EXIST_CHILDREN_NOT_ALLOWED
(
152
,
"存在下级机构,不可删除"
),
SYSTEM_OFFICE_EXIST_USER_NOT_ALLOWED
(
153
,
"该机构下存在用户,不可删除"
),
DATA_NOT_FOUND
(
154
,
"数据未找到"
),
SYSTEM_NOT_ADMIN_USER
(
155
,
"非admin账号,无法删除角色"
),
/**
* 字典
*/
SYS_DICTIONARY_CATEGORY_CODE_EXIT
(
500
,
"编码已存在"
),
SYS_DICTIONARY_CODE_EXIT
(
500
,
"编码已存在"
),
SYS_DICTIONARY_VALUE_EXIT
(
500
,
"数据值已存在"
),
/**
* 用户角色
*/
SYS_USER_ROLE_NOT_USER_EMPTY
(
500
,
"请至少选择一个用户或者角色"
),
VALIDATION_ERROR_EXCEPTION
(
1000
,
"数据校验编码"
),
SUB_LIBRARY_CODE_ERROR
(
2001
,
"子库编码需为字母+数字组合"
),
;
/**
* 消息码
*/
private
int
code
;
/**
* 消息内容
*/
private
String
message
;
private
GlobalCodeMessageEnum
(
int
code
,
String
message
)
{
this
.
code
=
code
;
this
.
message
=
message
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
}
\ No newline at end of file
matchtech-common/matchtech-common-dto/src/main/java/com/matchtech/common/dto/constants/HttpStatus.java
0 → 100644
View file @
72c20035
package
com
.
matchtech
.
common
.
dto
.
constants
;
/**
* 返回状态码
*
* @author matchtech
*/
public
class
HttpStatus
{
/**
* 操作成功
*/
public
static
final
int
SUCCESS
=
200
;
/**
* 对象创建成功
*/
public
static
final
int
CREATED
=
201
;
/**
* 请求已经被接受
*/
public
static
final
int
ACCEPTED
=
202
;
/**
* 操作已经执行成功,但是没有返回数据
*/
public
static
final
int
NO_CONTENT
=
204
;
/**
* 资源已被移除
*/
public
static
final
int
MOVED_PERM
=
301
;
/**
* 重定向
*/
public
static
final
int
SEE_OTHER
=
303
;
/**
* 资源没有被修改
*/
public
static
final
int
NOT_MODIFIED
=
304
;
/**
* 参数列表错误(缺少,格式不匹配)
*/
public
static
final
int
BAD_REQUEST
=
400
;
/**
* 未授权
*/
public
static
final
int
UNAUTHORIZED
=
401
;
/**
* 访问受限,授权过期
*/
public
static
final
int
FORBIDDEN
=
403
;
/**
* 资源,服务未找到
*/
public
static
final
int
NOT_FOUND
=
404
;
/**
* 不允许的http方法
*/
public
static
final
int
BAD_METHOD
=
405
;
/**
* 资源冲突,或者资源被锁
*/
public
static
final
int
CONFLICT
=
409
;
/**
* 不支持的数据,媒体类型
*/
public
static
final
int
UNSUPPORTED_TYPE
=
415
;
/**
* 系统内部错误
*/
public
static
final
int
ERROR
=
500
;
/**
* 接口未实现
*/
public
static
final
int
NOT_IMPLEMENTED
=
501
;
/**
* 系统警告消息
*/
public
static
final
int
WARN
=
601
;
}
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/page/PageParam.java
→
matchtech-common/matchtech-common-
dto/src/main/java/com/matchtech/common/dto
/page/PageParam.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
page
;
package
com
.
matchtech
.
common
.
dto
.
page
;
import
io.swagger.v3.oas.annotations.media.Schema
;
...
...
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/page/PageReqDto.java
→
matchtech-common/matchtech-common-
dto/src/main/java/com/matchtech/common/dto
/page/PageReqDto.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
page
;
package
com
.
matchtech
.
common
.
dto
.
page
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
...
...
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/page/PageResult.java
→
matchtech-common/matchtech-common-
dto/src/main/java/com/matchtech/common/dto
/page/PageResult.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
page
;
package
com
.
matchtech
.
common
.
dto
.
page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
...
...
@@ -56,32 +55,6 @@ public final class PageResult<T> implements Serializable {
this
.
pages
=
pages
;
}
public
PageResult
(
Page
<?>
page
,
List
<
T
>
list
)
{
this
.
list
=
list
;
this
.
count
=
page
.
getTotal
();
this
.
pageNo
=
(
int
)
page
.
getCurrent
();
this
.
pageSize
=
(
int
)
page
.
getSize
();
this
.
pages
=
(
int
)
page
.
getPages
();
}
public
static
<
T
>
PageVO
<
T
>
getPage
(
Page
<
T
>
pages
)
{
PageVO
<
T
>
data
=
new
PageVO
<>();
data
.
setList
(
pages
.
getRecords
());
data
.
setCount
(
pages
.
getTotal
());
data
.
setPageNo
((
int
)
pages
.
getCurrent
());
data
.
setPages
((
int
)
pages
.
getPages
());
data
.
setPageSize
((
int
)
pages
.
getSize
());
return
data
;
}
public
static
<
T
>
PageVO
<
T
>
getPage
(
Page
<?>
pages
,
List
<
T
>
list
)
{
PageVO
<
T
>
data
=
new
PageVO
<>();
data
.
setList
(
list
);
data
.
setCount
(
pages
.
getTotal
());
data
.
setPageNo
((
int
)
pages
.
getCurrent
());
data
.
setPages
((
int
)
pages
.
getPages
());
data
.
setPageSize
((
int
)
pages
.
getSize
());
return
data
;
}
}
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/page/ReqDTO.java
→
matchtech-common/matchtech-common-
dto/src/main/java/com/matchtech/common/dto
/page/ReqDTO.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
page
;
package
com
.
matchtech
.
common
.
dto
.
page
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
...
...
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/page/SortingField.java
→
matchtech-common/matchtech-common-
dto/src/main/java/com/matchtech/common/dto
/page/SortingField.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
page
;
package
com
.
matchtech
.
common
.
dto
.
page
;
import
java.io.Serializable
;
...
...
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/page/resp/ApiResponseEntity.java
→
matchtech-common/matchtech-common-
dto/src/main/java/com/matchtech/common/dto
/page/resp/ApiResponseEntity.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
page
.
resp
;
package
com
.
matchtech
.
common
.
dto
.
page
.
resp
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.matchtech.common.
core
.constants.GlobalCodeMessageEnum
;
import
com.matchtech.common.
dto
.constants.GlobalCodeMessageEnum
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
lombok.experimental.FieldNameConstants
;
...
...
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/page/resp/ApiResponseUtils.java
→
matchtech-common/matchtech-common-
dto/src/main/java/com/matchtech/common/dto
/page/resp/ApiResponseUtils.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
page
.
resp
;
package
com
.
matchtech
.
common
.
dto
.
page
.
resp
;
import
com.matchtech.common.core.constants.GlobalCodeMessageEnum
;
import
com.matchtech.common.dto.constants.GlobalCodeMessageEnum
;
/**
* @author Administrator
...
...
matchtech-common/matchtech-common-dto/src/main/java/com/matchtech/common/dto/web/AjaxResult.java
0 → 100644
View file @
72c20035
package
com
.
matchtech
.
common
.
dto
.
web
;
import
cn.hutool.core.util.StrUtil
;
import
com.matchtech.common.dto.constants.HttpStatus
;
import
java.util.HashMap
;
import
java.util.Objects
;
/**
* 操作消息提醒
*
* @author matchtech
*/
public
class
AjaxResult
extends
HashMap
<
String
,
Object
>
{
private
static
final
long
serialVersionUID
=
1L
;
/** 状态码 */
public
static
final
String
CODE_TAG
=
"code"
;
/** 返回内容 */
public
static
final
String
MSG_TAG
=
"msg"
;
/** 数据对象 */
public
static
final
String
DATA_TAG
=
"data"
;
/**
* 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
*/
public
AjaxResult
()
{
}
/**
* 初始化一个新创建的 AjaxResult 对象
*
* @param code 状态码
* @param msg 返回内容
*/
public
AjaxResult
(
int
code
,
String
msg
)
{
super
.
put
(
CODE_TAG
,
code
);
super
.
put
(
MSG_TAG
,
msg
);
}
/**
* 初始化一个新创建的 AjaxResult 对象
*
* @param code 状态码
* @param msg 返回内容
* @param data 数据对象
*/
public
AjaxResult
(
int
code
,
String
msg
,
Object
data
)
{
super
.
put
(
CODE_TAG
,
code
);
super
.
put
(
MSG_TAG
,
msg
);
if
(
Objects
.
nonNull
(
data
))
{
super
.
put
(
DATA_TAG
,
data
);
}
}
/**
* 返回成功消息
*
* @return 成功消息
*/
public
static
AjaxResult
success
()
{
return
AjaxResult
.
success
(
"操作成功"
);
}
/**
* 返回成功数据
*
* @return 成功消息
*/
public
static
AjaxResult
success
(
Object
data
)
{
return
AjaxResult
.
success
(
"操作成功"
,
data
);
}
/**
* 返回成功消息
*
* @param msg 返回内容
* @return 成功消息
*/
public
static
AjaxResult
success
(
String
msg
)
{
return
AjaxResult
.
success
(
msg
,
null
);
}
/**
* 返回成功消息
*
* @param msg 返回内容
* @param data 数据对象
* @return 成功消息
*/
public
static
AjaxResult
success
(
String
msg
,
Object
data
)
{
return
new
AjaxResult
(
HttpStatus
.
SUCCESS
,
msg
,
data
);
}
/**
* 返回警告消息
*
* @param msg 返回内容
* @return 警告消息
*/
public
static
AjaxResult
warn
(
String
msg
)
{
return
AjaxResult
.
warn
(
msg
,
null
);
}
/**
* 返回警告消息
*
* @param msg 返回内容
* @param data 数据对象
* @return 警告消息
*/
public
static
AjaxResult
warn
(
String
msg
,
Object
data
)
{
return
new
AjaxResult
(
HttpStatus
.
WARN
,
msg
,
data
);
}
/**
* 返回错误消息
*
* @return 错误消息
*/
public
static
AjaxResult
error
()
{
return
AjaxResult
.
error
(
"操作失败"
);
}
/**
* 返回错误消息
*
* @param msg 返回内容
* @return 错误消息
*/
public
static
AjaxResult
error
(
String
msg
)
{
return
AjaxResult
.
error
(
msg
,
null
);
}
/**
* 返回错误消息
*
* @param msg 返回内容
* @param data 数据对象
* @return 错误消息
*/
public
static
AjaxResult
error
(
String
msg
,
Object
data
)
{
return
new
AjaxResult
(
HttpStatus
.
ERROR
,
msg
,
data
);
}
/**
* 返回错误消息
*
* @param code 状态码
* @param msg 返回内容
* @return 错误消息
*/
public
static
AjaxResult
error
(
int
code
,
String
msg
)
{
return
new
AjaxResult
(
code
,
msg
,
null
);
}
/**
* 是否为成功消息
*
* @return 结果
*/
public
boolean
isSuccess
()
{
return
Objects
.
equals
(
HttpStatus
.
SUCCESS
,
this
.
get
(
CODE_TAG
));
}
/**
* 是否为警告消息
*
* @return 结果
*/
public
boolean
isWarn
()
{
return
Objects
.
equals
(
HttpStatus
.
WARN
,
this
.
get
(
CODE_TAG
));
}
/**
* 是否为错误消息
*
* @return 结果
*/
public
boolean
isError
()
{
return
Objects
.
equals
(
HttpStatus
.
ERROR
,
this
.
get
(
CODE_TAG
));
}
/**
* 方便链式调用
*
* @param key
* @param value
* @return
*/
@Override
public
AjaxResult
put
(
String
key
,
Object
value
)
{
super
.
put
(
key
,
value
);
return
this
;
}
}
matchtech-common/matchtech-common-log/src/main/java/com/matchtech/common/log/aspect/LogAspect.java
View file @
72c20035
...
...
@@ -2,6 +2,9 @@ package com.matchtech.common.log.aspect;
import
java.util.Collection
;
import
java.util.Map
;
import
com.matchtech.common.servlet.utils.ServletUtils
;
import
com.matchtech.common.servlet.utils.ip.IpUtils
;
import
jakarta.servlet.http.HttpServletRequest
;
import
jakarta.servlet.http.HttpServletResponse
;
import
org.apache.commons.lang3.ArrayUtils
;
...
...
@@ -21,9 +24,7 @@ import org.springframework.web.multipart.MultipartFile;
import
com.alibaba.fastjson2.JSON
;
import
com.matchtech.common.core.text.Convert
;
import
com.matchtech.common.core.utils.ExceptionUtil
;
import
com.matchtech.common.core.utils.ServletUtils
;
import
com.matchtech.common.core.utils.StringUtils
;
import
com.matchtech.common.core.utils.ip.IpUtils
;
import
com.matchtech.common.log.annotation.Log
;
import
com.matchtech.common.log.enums.BusinessStatus
;
import
com.matchtech.common.log.filter.PropertyPreExcludeFilter
;
...
...
matchtech-common/matchtech-common-mybatis/pom.xml
0 → 100644
View file @
72c20035
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common
</artifactId>
<version>
3.1.1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
matchtech-common-mybatis
</artifactId>
<description>
matchtech-common-mybatis
</description>
<dependencies>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-extension
</artifactId>
</dependency>
<!-- MyBatis 测试 -->
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter-test
</artifactId>
<version>
3.0.2
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-dto
</artifactId>
</dependency>
<dependency>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-core
</artifactId>
</dependency>
</dependencies>
</project>
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/mybatis/BaseMapperX.java
→
matchtech-common/matchtech-common-
mybatis/src/main/java/com/matchtech/common
/mybatis/BaseMapperX.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
mybatis
;
package
com
.
matchtech
.
common
.
mybatis
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -7,11 +7,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.support.SFunction
;
import
com.baomidou.mybatisplus.extension.toolkit.Db
;
import
com.matchtech.common.core.page.PageParam
;
import
com.matchtech.common.core.page.PageReqDto
;
import
com.matchtech.common.core.page.PageResult
;
import
com.matchtech.common.core.page.SortingField
;
import
com.matchtech.common.core.text.Convert
;
import
com.matchtech.common.dto.page.PageParam
;
import
com.matchtech.common.dto.page.PageReqDto
;
import
com.matchtech.common.dto.page.PageResult
;
import
com.matchtech.common.dto.page.SortingField
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/mybatis/LambdaQueryWrapperX.java
→
matchtech-common/matchtech-common-
mybatis/src/main/java/com/matchtech/common
/mybatis/LambdaQueryWrapperX.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
mybatis
;
package
com
.
matchtech
.
common
.
mybatis
;
import
cn.hutool.core.util.ArrayUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/mybatis/MyBatisUtils.java
→
matchtech-common/matchtech-common-
mybatis/src/main/java/com/matchtech/common
/mybatis/MyBatisUtils.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
mybatis
;
package
com
.
matchtech
.
common
.
mybatis
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
...
@@ -7,12 +7,11 @@ import com.baomidou.mybatisplus.core.toolkit.StringPool;
import
com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.matchtech.common.core.page.PageParam
;
import
com.matchtech.common.core.page.PageReqDto
;
import
com.matchtech.common.core.page.PageResult
;
import
com.matchtech.common.core.page.SortingField
;
import
com.matchtech.common.core.text.Convert
;
import
com.matchtech.common.dto.page.PageParam
;
import
com.matchtech.common.dto.page.PageReqDto
;
import
com.matchtech.common.dto.page.PageResult
;
import
com.matchtech.common.dto.page.SortingField
;
import
net.sf.jsqlparser.expression.Alias
;
import
net.sf.jsqlparser.schema.Column
;
import
net.sf.jsqlparser.schema.Table
;
...
...
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/mybatis/QueryCondition.java
→
matchtech-common/matchtech-common-
mybatis/src/main/java/com/matchtech/common
/mybatis/QueryCondition.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
mybatis
;
package
com
.
matchtech
.
common
.
mybatis
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
...
...
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/mybatis/QueryConditionEnum.java
→
matchtech-common/matchtech-common-
mybatis/src/main/java/com/matchtech/common
/mybatis/QueryConditionEnum.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
mybatis
;
package
com
.
matchtech
.
common
.
mybatis
;
import
com.baomidou.mybatisplus.core.conditions.AbstractWrapper
;
...
...
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/mybatis/QueryWrapperX.java
→
matchtech-common/matchtech-common-
mybatis/src/main/java/com/matchtech/common
/mybatis/QueryWrapperX.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
mybatis
;
package
com
.
matchtech
.
common
.
mybatis
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.ArrayUtils
;
...
...
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/domain/BaseEntity.java
→
matchtech-common/matchtech-common-
mybatis/src/main/java/com/matchtech/common/mybatis
/domain/BaseEntity.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
domain
;
package
com
.
matchtech
.
common
.
mybatis
.
domain
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.IdType
;
...
...
matchtech-common/matchtech-common-mybatis/src/main/java/com/matchtech/common/mybatis/utils/PageUtil.java
0 → 100644
View file @
72c20035
package
com
.
matchtech
.
common
.
mybatis
.
utils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.matchtech.common.dto.page.PageResult
;
import
java.util.List
;
/**
* @author lixl
*/
public
class
PageUtil
{
public
static
<
T
>
PageResult
toPageResult
(
Page
<?>
page
,
List
<
T
>
list
)
{
PageResult
res
=
new
PageResult
();
res
.
setList
(
list
);
res
.
setCount
(
page
.
getTotal
());
res
.
setPageNo
((
int
)
page
.
getCurrent
());
res
.
setPages
((
int
)
page
.
getPages
());
res
.
setPageSize
((
int
)
page
.
getSize
());
return
res
;
}
}
matchtech-common/matchtech-common-mybatis/src/main/resources/application.properties
0 → 100644
View file @
72c20035
File mode changed
matchtech-common/matchtech-common-security/pom.xml
View file @
72c20035
...
...
@@ -39,6 +39,11 @@
<artifactId>
matchtech-common-dto
</artifactId>
</dependency>
<dependency>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-servlet
</artifactId>
</dependency>
</dependencies>
</project>
matchtech-common/matchtech-common-security/src/main/java/com/matchtech/common/security/aspect/InnerAuthAspect.java
View file @
72c20035
package
com
.
matchtech
.
common
.
security
.
aspect
;
import
com.matchtech.common.servlet.utils.ServletUtils
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.Around
;
import
org.aspectj.lang.annotation.Aspect
;
...
...
@@ -7,7 +8,6 @@ import org.springframework.core.Ordered;
import
org.springframework.stereotype.Component
;
import
com.matchtech.common.core.constants.SecurityConstants
;
import
com.matchtech.common.core.exception.InnerAuthException
;
import
com.matchtech.common.core.utils.ServletUtils
;
import
com.matchtech.common.core.utils.StringUtils
;
import
com.matchtech.common.security.annotation.InnerAuth
;
...
...
matchtech-common/matchtech-common-security/src/main/java/com/matchtech/common/security/feign/FeignRequestInterceptor.java
View file @
72c20035
package
com
.
matchtech
.
common
.
security
.
feign
;
import
java.util.Map
;
import
com.matchtech.common.servlet.utils.ServletUtils
;
import
com.matchtech.common.servlet.utils.ip.IpUtils
;
import
jakarta.servlet.http.HttpServletRequest
;
import
org.springframework.stereotype.Component
;
import
com.matchtech.common.core.constants.SecurityConstants
;
import
com.matchtech.common.core.utils.ServletUtils
;
import
com.matchtech.common.core.utils.StringUtils
;
import
com.matchtech.common.core.utils.ip.IpUtils
;
import
feign.RequestInterceptor
;
import
feign.RequestTemplate
;
...
...
matchtech-common/matchtech-common-security/src/main/java/com/matchtech/common/security/interceptor/HeaderInterceptor.java
View file @
72c20035
package
com
.
matchtech
.
common
.
security
.
interceptor
;
import
com.matchtech.common.servlet.utils.ServletUtils
;
import
jakarta.servlet.http.HttpServletRequest
;
import
jakarta.servlet.http.HttpServletResponse
;
import
org.springframework.web.method.HandlerMethod
;
import
org.springframework.web.servlet.AsyncHandlerInterceptor
;
import
com.matchtech.common.core.constants.SecurityConstants
;
import
com.matchtech.common.core.context.SecurityContextHolder
;
import
com.matchtech.common.core.utils.ServletUtils
;
import
com.matchtech.common.core.utils.StringUtils
;
import
com.matchtech.common.security.auth.AuthUtil
;
import
com.matchtech.common.security.utils.SecurityUtils
;
...
...
matchtech-common/matchtech-common-security/src/main/java/com/matchtech/common/security/service/TokenService.java
View file @
72c20035
...
...
@@ -5,6 +5,8 @@ import java.util.Map;
import
java.util.concurrent.TimeUnit
;
import
com.matchtech.common.dto.login.TokenDto
;
import
com.matchtech.common.servlet.utils.ServletUtils
;
import
com.matchtech.common.servlet.utils.ip.IpUtils
;
import
jakarta.servlet.http.HttpServletRequest
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -13,9 +15,7 @@ import org.springframework.stereotype.Component;
import
com.matchtech.common.core.constants.CacheConstants
;
import
com.matchtech.common.core.constants.SecurityConstants
;
import
com.matchtech.common.core.utils.JwtUtils
;
import
com.matchtech.common.core.utils.ServletUtils
;
import
com.matchtech.common.core.utils.StringUtils
;
import
com.matchtech.common.core.utils.ip.IpUtils
;
import
com.matchtech.common.core.utils.uuid.IdUtils
;
import
com.matchtech.common.redis.service.RedisService
;
import
com.matchtech.common.security.utils.SecurityUtils
;
...
...
matchtech-common/matchtech-common-security/src/main/java/com/matchtech/common/security/utils/SecurityUtils.java
View file @
72c20035
package
com
.
matchtech
.
common
.
security
.
utils
;
import
com.matchtech.common.servlet.utils.ServletUtils
;
import
jakarta.servlet.http.HttpServletRequest
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
com.matchtech.common.core.constants.SecurityConstants
;
import
com.matchtech.common.core.constants.TokenConstants
;
import
com.matchtech.common.core.context.SecurityContextHolder
;
import
com.matchtech.common.core.utils.ServletUtils
;
import
com.matchtech.common.core.utils.StringUtils
;
import
com.matchtech.system.api.model.LoginUser
;
...
...
matchtech-common/matchtech-common-servlet/pom.xml
0 → 100644
View file @
72c20035
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common
</artifactId>
<version>
3.1.1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-servlet
</artifactId>
<version>
3.1.1
</version>
<name>
matchtech-common-servlet
</name>
<description>
matchtech-common-servlet
</description>
<dependencies>
<!-- Spring Web -->
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-web
</artifactId>
</dependency>
<!-- Java Servlet -->
<dependency>
<groupId>
jakarta.servlet
</groupId>
<artifactId>
jakarta.servlet-api
</artifactId>
</dependency>
<dependency>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-core
</artifactId>
</dependency>
</dependencies>
</project>
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core/utils
/poi/ExcelHandlerAdapter.java
→
matchtech-common/matchtech-common-
servlet/src/main/java/com/matchtech/common/servlet
/poi/ExcelHandlerAdapter.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
utils
.
poi
;
package
com
.
matchtech
.
common
.
servlet
.
poi
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.Workbook
;
...
...
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core/utils
/poi/ExcelUtil.java
→
matchtech-common/matchtech-common-
servlet/src/main/java/com/matchtech/common/servlet
/poi/ExcelUtil.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
utils
.
poi
;
package
com
.
matchtech
.
common
.
servlet
.
poi
;
import
java.io.IOException
;
import
java.io.InputStream
;
...
...
@@ -454,10 +454,10 @@ public class ExcelUtil<T>
{
val
=
reverseByExp
(
Convert
.
toStr
(
val
),
attr
.
readConverterExp
(),
attr
.
separator
());
}
else
if
(!
attr
.
handler
().
equals
(
ExcelHandlerAdapter
.
class
))
{
val
=
dataFormatHandlerAdapter
(
val
,
attr
,
null
);
}
//
else if (!attr.handler().equals(ExcelHandlerAdapter.class))
//
{
//
val = dataFormatHandlerAdapter(val, attr, null);
//
}
ReflectUtils
.
invokeSetter
(
entity
,
propertyName
,
val
);
}
}
...
...
@@ -1015,10 +1015,10 @@ public class ExcelUtil<T>
{
cell
.
setCellValue
((((
BigDecimal
)
value
).
setScale
(
attr
.
scale
(),
attr
.
roundingMode
())).
doubleValue
());
}
else
if
(!
attr
.
handler
().
equals
(
ExcelHandlerAdapter
.
class
))
{
cell
.
setCellValue
(
dataFormatHandlerAdapter
(
value
,
attr
,
cell
));
}
//
else if (!attr.handler().equals(ExcelHandlerAdapter.class))
//
{
//
cell.setCellValue(dataFormatHandlerAdapter(value, attr, cell));
//
}
else
{
// 设置列类型
...
...
@@ -1226,13 +1226,13 @@ public class ExcelUtil<T>
{
try
{
Object
instance
=
excel
.
handler
().
getDeclaredConstructor
().
newInstance
();
Method
formatMethod
=
excel
.
handler
().
getMethod
(
"format"
,
new
Class
[]
{
Object
.
class
,
String
[].
class
,
Cell
.
class
,
Workbook
.
class
});
value
=
formatMethod
.
invoke
(
instance
,
value
,
excel
.
args
(),
cell
,
this
.
wb
);
//
Object instance = excel.handler().getDeclaredConstructor().newInstance();
//
Method formatMethod = excel.handler().getMethod("format", new Class[] { Object.class, String[].class, Cell.class, Workbook.class });
//
value = formatMethod.invoke(instance, value, excel.args(), cell, this.wb);
}
catch
(
Exception
e
)
{
log
.
error
(
"不能格式化数据 "
+
excel
.
handler
(),
e
.
getMessage
());
//
log.error("不能格式化数据 " + excel.handler(), e.getMessage());
}
return
Convert
.
toStr
(
value
);
}
...
...
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/servlet/MyHttpServletRequestWrapper.java
→
matchtech-common/matchtech-common-
servlet/src/main/java/com/matchtech/common/servlet
/servlet/MyHttpServletRequestWrapper.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
servlet
;
package
com
.
matchtech
.
common
.
servlet
.
servlet
;
import
jakarta.servlet.ReadListener
;
import
jakarta.servlet.ServletInputStream
;
...
...
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/servlet/MyHttpServletResponseWrapper.java
→
matchtech-common/matchtech-common-
servlet/src/main/java/com/matchtech/common/servlet
/servlet/MyHttpServletResponseWrapper.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
servlet
;
package
com
.
matchtech
.
common
.
servlet
.
servlet
;
import
jakarta.servlet.ServletOutputStream
;
import
jakarta.servlet.WriteListener
;
...
...
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/servlet/RequestReadUtils.java
→
matchtech-common/matchtech-common-
servlet/src/main/java/com/matchtech/common/servlet
/servlet/RequestReadUtils.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
servlet
;
package
com
.
matchtech
.
common
.
servlet
.
servlet
;
import
jakarta.servlet.http.HttpServletRequest
;
import
org.slf4j.Logger
;
...
...
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/utils/ServletUtils.java
→
matchtech-common/matchtech-common-
servlet/src/main/java/com/matchtech/common/servlet
/utils/ServletUtils.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
utils
;
package
com
.
matchtech
.
common
.
servlet
.
utils
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLDecoder
;
import
java.net.URLEncoder
;
import
java.util.Collections
;
import
java.util.Enumeration
;
import
java.util.HashMap
;
import
java.util.Map
;
import
com.matchtech.common.core.constants.Constants
;
import
com.matchtech.common.core.text.Convert
;
import
com.matchtech.common.core.utils.StringUtils
;
import
jakarta.servlet.ServletRequest
;
import
jakarta.servlet.http.HttpServletRequest
;
import
jakarta.servlet.http.HttpServletResponse
;
import
jakarta.servlet.http.HttpSession
;
import
org.springframework.core.io.buffer.DataBuffer
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.server.reactive.ServerHttpResponse
;
import
org.springframework.util.LinkedCaseInsensitiveMap
;
import
org.springframework.web.context.request.RequestAttributes
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
com.alibaba.fastjson2.JSON
;
import
com.matchtech.common.core.constants.Constants
;
import
com.matchtech.common.core.domain.R
;
import
com.matchtech.common.core.text.Convert
;
import
reactor.core.publisher.Mono
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLDecoder
;
import
java.net.URLEncoder
;
import
java.util.Collections
;
import
java.util.Enumeration
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* 客户端工具类
...
...
@@ -237,17 +231,18 @@ public class ServletUtils
return
StringUtils
.
inStringIgnoreCase
(
ajax
,
"json"
,
"xml"
);
}
/**
* 内容
编
码
* 内容
解
码
*
* @param str 内容
* @return
编
码后的内容
* @return
解
码后的内容
*/
public
static
String
url
En
code
(
String
str
)
public
static
String
url
De
code
(
String
str
)
{
try
{
return
URL
Encoder
.
en
code
(
str
,
Constants
.
UTF8
);
return
URL
Decoder
.
de
code
(
str
,
Constants
.
UTF8
);
}
catch
(
UnsupportedEncodingException
e
)
{
...
...
@@ -256,16 +251,16 @@ public class ServletUtils
}
/**
* 内容
解
码
* 内容
编
码
*
* @param str 内容
* @return
解
码后的内容
* @return
编
码后的内容
*/
public
static
String
url
De
code
(
String
str
)
public
static
String
url
En
code
(
String
str
)
{
try
{
return
URL
Decoder
.
de
code
(
str
,
Constants
.
UTF8
);
return
URL
Encoder
.
en
code
(
str
,
Constants
.
UTF8
);
}
catch
(
UnsupportedEncodingException
e
)
{
...
...
@@ -273,61 +268,6 @@ public class ServletUtils
}
}
/**
* 设置webflux模型响应
*
* @param response ServerHttpResponse
* @param value 响应内容
* @return Mono<Void>
*/
public
static
Mono
<
Void
>
webFluxResponseWriter
(
ServerHttpResponse
response
,
Object
value
)
{
return
webFluxResponseWriter
(
response
,
HttpStatus
.
OK
,
value
,
R
.
FAIL
);
}
/**
* 设置webflux模型响应
*
* @param response ServerHttpResponse
* @param code 响应状态码
* @param value 响应内容
* @return Mono<Void>
*/
public
static
Mono
<
Void
>
webFluxResponseWriter
(
ServerHttpResponse
response
,
Object
value
,
int
code
)
{
return
webFluxResponseWriter
(
response
,
HttpStatus
.
OK
,
value
,
code
);
}
/**
* 设置webflux模型响应
*
* @param response ServerHttpResponse
* @param status http状态码
* @param code 响应状态码
* @param value 响应内容
* @return Mono<Void>
*/
public
static
Mono
<
Void
>
webFluxResponseWriter
(
ServerHttpResponse
response
,
HttpStatus
status
,
Object
value
,
int
code
)
{
return
webFluxResponseWriter
(
response
,
MediaType
.
APPLICATION_JSON_VALUE
,
status
,
value
,
code
);
}
/**
* 设置webflux模型响应
*
* @param response ServerHttpResponse
* @param contentType content-type
* @param status http状态码
* @param code 响应状态码
* @param value 响应内容
* @return Mono<Void>
*/
public
static
Mono
<
Void
>
webFluxResponseWriter
(
ServerHttpResponse
response
,
String
contentType
,
HttpStatus
status
,
Object
value
,
int
code
)
{
response
.
setStatusCode
(
status
);
response
.
getHeaders
().
add
(
HttpHeaders
.
CONTENT_TYPE
,
contentType
);
R
<?>
result
=
R
.
fail
(
code
,
value
.
toString
());
DataBuffer
dataBuffer
=
response
.
bufferFactory
().
wrap
(
JSON
.
toJSONString
(
result
).
getBytes
());
return
response
.
writeWith
(
Mono
.
just
(
dataBuffer
));
}
}
matchtech-common/matchtech-common-
core/src/main/java/com/matchtech/common/core
/utils/ip/IpUtils.java
→
matchtech-common/matchtech-common-
servlet/src/main/java/com/matchtech/common/servlet
/utils/ip/IpUtils.java
View file @
72c20035
package
com
.
matchtech
.
common
.
core
.
utils
.
ip
;
package
com
.
matchtech
.
common
.
servlet
.
utils
.
ip
;
import
java.net.InetAddress
;
import
java.net.UnknownHostException
;
import
com.matchtech.common.servlet.utils.ServletUtils
;
import
jakarta.servlet.http.HttpServletRequest
;
import
com.matchtech.common.core.utils.ServletUtils
;
import
com.matchtech.common.core.utils.StringUtils
;
/**
...
...
matchtech-common/matchtech-common-servlet/src/main/resources/application.properties
0 → 100644
View file @
72c20035
matchtech-common/matchtech-common-swagger/pom.xml
deleted
100644 → 0
View file @
52ba6026
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns=
"http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common
</artifactId>
<version>
3.1.1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
matchtech-common-swagger
</artifactId>
<description>
matchtech-common-swagger系统接口
</description>
<dependencies>
<!-- SpringBoot Web -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<!-- SpringDoc webmvc -->
<dependency>
<groupId>
org.springdoc
</groupId>
<artifactId>
springdoc-openapi-starter-webmvc-ui
</artifactId>
</dependency>
<!-- knife4j -->
<dependency>
<groupId>
io.springboot
</groupId>
<artifactId>
knife4j-openapi3-ui
</artifactId>
</dependency>
<dependency>
<groupId>
io.swagger.core.v3
</groupId>
<artifactId>
swagger-annotations
</artifactId>
</dependency>
</dependencies>
</project>
matchtech-common/matchtech-common-swagger/src/main/java/com/matchtech/common/swagger/config/SpringDocAutoConfiguration.java
deleted
100644 → 0
View file @
52ba6026
package
com
.
matchtech
.
common
.
swagger
.
config
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.springdoc.core.configuration.SpringDocConfiguration
;
import
org.springframework.boot.autoconfigure.AutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
com.matchtech.common.swagger.config.properties.SpringDocProperties
;
import
io.swagger.v3.oas.models.Components
;
import
io.swagger.v3.oas.models.OpenAPI
;
import
io.swagger.v3.oas.models.info.Info
;
import
io.swagger.v3.oas.models.security.SecurityRequirement
;
import
io.swagger.v3.oas.models.security.SecurityScheme
;
import
io.swagger.v3.oas.models.servers.Server
;
/**
* Swagger 文档配置
*
* @author matchtech
*/
@AutoConfiguration
(
before
=
SpringDocConfiguration
.
class
)
@EnableConfigurationProperties
(
SpringDocProperties
.
class
)
@ConditionalOnProperty
(
name
=
"springdoc.api-docs.enabled"
,
havingValue
=
"true"
,
matchIfMissing
=
true
)
public
class
SpringDocAutoConfiguration
{
@Bean
@ConditionalOnMissingBean
(
OpenAPI
.
class
)
public
OpenAPI
openApi
(
SpringDocProperties
properties
)
{
return
new
OpenAPI
().
components
(
new
Components
()
// 设置认证的请求头
.
addSecuritySchemes
(
"apikey"
,
securityScheme
()))
.
addSecurityItem
(
new
SecurityRequirement
().
addList
(
"apikey"
))
.
info
(
convertInfo
(
properties
.
getInfo
()))
.
servers
(
servers
(
properties
.
getGatewayUrl
()));
}
public
SecurityScheme
securityScheme
()
{
return
new
SecurityScheme
().
type
(
SecurityScheme
.
Type
.
APIKEY
)
.
name
(
"Authorization"
)
.
in
(
SecurityScheme
.
In
.
HEADER
)
.
scheme
(
"Bearer"
);
}
private
Info
convertInfo
(
SpringDocProperties
.
InfoProperties
infoProperties
)
{
Info
info
=
new
Info
();
info
.
setTitle
(
infoProperties
.
getTitle
());
info
.
setDescription
(
infoProperties
.
getDescription
());
info
.
setContact
(
infoProperties
.
getContact
());
info
.
setLicense
(
infoProperties
.
getLicense
());
info
.
setVersion
(
infoProperties
.
getVersion
());
return
info
;
}
public
List
<
Server
>
servers
(
String
gatewayUrl
)
{
List
<
Server
>
serverList
=
new
ArrayList
<>();
serverList
.
add
(
new
Server
().
url
(
gatewayUrl
));
return
serverList
;
}
}
matchtech-common/matchtech-common-swagger/src/main/java/com/matchtech/common/swagger/config/properties/SpringDocProperties.java
deleted
100644 → 0
View file @
52ba6026
package
com
.
matchtech
.
common
.
swagger
.
config
.
properties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.NestedConfigurationProperty
;
import
io.swagger.v3.oas.models.info.Contact
;
import
io.swagger.v3.oas.models.info.License
;
/**
* Swagger 配置属性
*
* @author matchtech
*/
@ConfigurationProperties
(
prefix
=
"springdoc"
)
public
class
SpringDocProperties
{
/**
* 网关
*/
private
String
gatewayUrl
;
/**
* 文档基本信息
*/
@NestedConfigurationProperty
private
InfoProperties
info
=
new
InfoProperties
();
/**
* <p>
* 文档的基础属性信息
* </p>
*
* @see io.swagger.v3.oas.models.info.Info
*
* 为了 springboot 自动生产配置提示信息,所以这里复制一个类出来
*/
public
static
class
InfoProperties
{
/**
* 标题
*/
private
String
title
=
null
;
/**
* 描述
*/
private
String
description
=
null
;
/**
* 联系人信息
*/
@NestedConfigurationProperty
private
Contact
contact
=
null
;
/**
* 许可证
*/
@NestedConfigurationProperty
private
License
license
=
null
;
/**
* 版本
*/
private
String
version
=
null
;
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
Contact
getContact
()
{
return
contact
;
}
public
void
setContact
(
Contact
contact
)
{
this
.
contact
=
contact
;
}
public
License
getLicense
()
{
return
license
;
}
public
void
setLicense
(
License
license
)
{
this
.
license
=
license
;
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
}
public
String
getGatewayUrl
()
{
return
gatewayUrl
;
}
public
void
setGatewayUrl
(
String
gatewayUrl
)
{
this
.
gatewayUrl
=
gatewayUrl
;
}
public
InfoProperties
getInfo
()
{
return
info
;
}
public
void
setInfo
(
InfoProperties
info
)
{
this
.
info
=
info
;
}
}
matchtech-common/matchtech-common-swagger/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
deleted
100644 → 0
View file @
52ba6026
com.matchtech.common.swagger.config.SpringDocAutoConfiguration
\ No newline at end of file
matchtech-common/pom.xml
View file @
72c20035
...
...
@@ -25,12 +25,13 @@
<module>
matchtech-common-core
</module>
<module>
matchtech-common-redis
</module>
<module>
matchtech-common-seata
</module>
<module>
matchtech-common-swagger
</module>
<module>
matchtech-common-security
</module>
<module>
matchtech-common-sensitive
</module>
<module>
matchtech-common-datascope
</module>
<module>
matchtech-common-datasource
</module>
<module>
matchtech-common-dto
</module>
<module>
matchtech-common-mybatis
</module>
<module>
matchtech-common-servlet
</module>
</modules>
<artifactId>
matchtech-common
</artifactId>
...
...
matchtech-gateway/pom.xml
View file @
72c20035
...
...
@@ -93,11 +93,17 @@
<version>
1.8.0
</version>
</dependency>
<!--引入Knife4j的gateway包-->
<!-- knife4j -->
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-spring-ui
</artifactId>
<version>
3.0.3
</version>
</dependency>
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-
gateway-
spring-boot-starter
</artifactId>
<version>
4.5.0
</version>
<artifactId>
knife4j-spring-boot-starter
</artifactId>
<version>
3.0.3
</version>
</dependency>
</dependencies>
...
...
matchtech-gateway/src/main/java/com/matchtech/gateway/filter/AuthFilter.java
View file @
72c20035
package
com
.
matchtech
.
gateway
.
filter
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cloud.gateway.filter.GatewayFilterChain
;
import
org.springframework.cloud.gateway.filter.GlobalFilter
;
import
org.springframework.core.Ordered
;
import
org.springframework.http.server.reactive.ServerHttpRequest
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.server.ServerWebExchange
;
import
com.matchtech.common.core.constants.CacheConstants
;
import
com.matchtech.common.core.constants.HttpStatus
;
import
com.matchtech.common.core.constants.SecurityConstants
;
import
com.matchtech.common.core.constants.TokenConstants
;
import
com.matchtech.common.core.utils.JwtUtils
;
import
com.matchtech.common.core.utils.ServletUtils
;
import
com.matchtech.common.core.utils.StringUtils
;
import
com.matchtech.common.redis.service.RedisService
;
import
com.matchtech.gateway.config.properties.IgnoreWhiteProperties
;
import
com.matchtech.gateway.utils.WebFluxUtil
;
import
io.jsonwebtoken.Claims
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cloud.gateway.filter.GatewayFilterChain
;
import
org.springframework.cloud.gateway.filter.GlobalFilter
;
import
org.springframework.core.Ordered
;
import
org.springframework.http.server.reactive.ServerHttpRequest
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.server.ServerWebExchange
;
import
reactor.core.publisher.Mono
;
/**
...
...
@@ -92,7 +92,7 @@ public class AuthFilter implements GlobalFilter, Ordered
return
;
}
String
valueStr
=
value
.
toString
();
String
valueEncode
=
ServletUtils
.
urlEncode
(
valueStr
);
String
valueEncode
=
WebFluxUtil
.
urlEncode
(
valueStr
);
mutate
.
header
(
name
,
valueEncode
);
}
...
...
@@ -104,7 +104,7 @@ public class AuthFilter implements GlobalFilter, Ordered
private
Mono
<
Void
>
unauthorizedResponse
(
ServerWebExchange
exchange
,
String
msg
)
{
log
.
error
(
"[鉴权异常处理]请求路径:{},错误信息:{}"
,
exchange
.
getRequest
().
getPath
(),
msg
);
return
ServletUtils
.
webFluxResponseWriter
(
exchange
.
getResponse
(),
msg
,
HttpStatus
.
UNAUTHORIZED
);
return
WebFluxUtil
.
webFluxResponseWriter
(
exchange
.
getResponse
(),
msg
,
HttpStatus
.
UNAUTHORIZED
);
}
/**
...
...
matchtech-gateway/src/main/java/com/matchtech/gateway/filter/BlackListUrlFilter.java
View file @
72c20035
package
com
.
matchtech
.
gateway
.
filter
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.regex.Pattern
;
import
com.matchtech.gateway.utils.WebFluxUtil
;
import
org.springframework.cloud.gateway.filter.GatewayFilter
;
import
org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory
;
import
org.springframework.stereotype.Component
;
import
com.matchtech.common.core.utils.ServletUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.regex.Pattern
;
/**
* 黑名单过滤器
...
...
@@ -24,7 +25,7 @@ public class BlackListUrlFilter extends AbstractGatewayFilterFactory<BlackListUr
String
url
=
exchange
.
getRequest
().
getURI
().
getPath
();
if
(
config
.
matchBlacklist
(
url
))
{
return
ServletUtils
.
webFluxResponseWriter
(
exchange
.
getResponse
(),
"请求地址不允许访问"
);
return
WebFluxUtil
.
webFluxResponseWriter
(
exchange
.
getResponse
(),
"请求地址不允许访问"
);
}
return
chain
.
filter
(
exchange
);
...
...
matchtech-gateway/src/main/java/com/matchtech/gateway/filter/ValidateCodeFilter.java
View file @
72c20035
package
com
.
matchtech
.
gateway
.
filter
;
import
java.nio.CharBuffer
;
import
java.nio.charset.StandardCharsets
;
import
java.util.concurrent.atomic.AtomicReference
;
import
com.alibaba.fastjson2.JSON
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.matchtech.common.core.utils.StringUtils
;
import
com.matchtech.gateway.config.properties.CaptchaProperties
;
import
com.matchtech.gateway.service.ValidateCodeService
;
import
com.matchtech.gateway.utils.WebFluxUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cloud.gateway.filter.GatewayFilter
;
import
org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory
;
...
...
@@ -10,14 +13,12 @@ import org.springframework.core.io.buffer.DataBuffer;
import
org.springframework.core.io.buffer.DataBufferUtils
;
import
org.springframework.http.server.reactive.ServerHttpRequest
;
import
org.springframework.stereotype.Component
;
import
com.alibaba.fastjson2.JSON
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.matchtech.common.core.utils.ServletUtils
;
import
com.matchtech.common.core.utils.StringUtils
;
import
com.matchtech.gateway.config.properties.CaptchaProperties
;
import
com.matchtech.gateway.service.ValidateCodeService
;
import
reactor.core.publisher.Flux
;
import
java.nio.CharBuffer
;
import
java.nio.charset.StandardCharsets
;
import
java.util.concurrent.atomic.AtomicReference
;
/**
* 验证码过滤器
*
...
...
@@ -58,7 +59,7 @@ public class ValidateCodeFilter extends AbstractGatewayFilterFactory<Object>
}
catch
(
Exception
e
)
{
return
ServletUtils
.
webFluxResponseWriter
(
exchange
.
getResponse
(),
e
.
getMessage
());
return
WebFluxUtil
.
webFluxResponseWriter
(
exchange
.
getResponse
(),
e
.
getMessage
());
}
return
chain
.
filter
(
exchange
);
};
...
...
matchtech-gateway/src/main/java/com/matchtech/gateway/handler/GatewayExceptionHandler.java
View file @
72c20035
package
com
.
matchtech
.
gateway
.
handler
;
import
com.matchtech.gateway.utils.WebFluxUtil
;
import
org.springframework.cloud.gateway.support.NotFoundException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -9,7 +10,6 @@ import org.springframework.core.annotation.Order;
import
org.springframework.http.server.reactive.ServerHttpResponse
;
import
org.springframework.web.server.ResponseStatusException
;
import
org.springframework.web.server.ServerWebExchange
;
import
com.matchtech.common.core.utils.ServletUtils
;
import
reactor.core.publisher.Mono
;
/**
...
...
@@ -51,6 +51,6 @@ public class GatewayExceptionHandler implements ErrorWebExceptionHandler
log
.
error
(
"[网关异常处理]请求路径:{},异常信息:{}"
,
exchange
.
getRequest
().
getPath
(),
ex
.
getMessage
());
return
ServletUtils
.
webFluxResponseWriter
(
response
,
msg
);
return
WebFluxUtil
.
webFluxResponseWriter
(
response
,
msg
);
}
}
\ No newline at end of file
matchtech-gateway/src/main/java/com/matchtech/gateway/handler/SentinelFallbackHandler.java
View file @
72c20035
...
...
@@ -2,7 +2,7 @@ package com.matchtech.gateway.handler;
import
com.alibaba.csp.sentinel.adapter.gateway.sc.callback.GatewayCallbackManager
;
import
com.alibaba.csp.sentinel.slots.block.BlockException
;
import
com.matchtech.
common.core.utils.ServletUtils
;
import
com.matchtech.
gateway.utils.WebFluxUtil
;
import
org.springframework.web.reactive.function.server.ServerResponse
;
import
org.springframework.web.server.ServerWebExchange
;
import
org.springframework.web.server.WebExceptionHandler
;
...
...
@@ -17,7 +17,7 @@ public class SentinelFallbackHandler implements WebExceptionHandler
{
private
Mono
<
Void
>
writeResponse
(
ServerResponse
response
,
ServerWebExchange
exchange
)
{
return
ServletUtils
.
webFluxResponseWriter
(
exchange
.
getResponse
(),
"请求超过最大数,请稍候再试"
);
return
WebFluxUtil
.
webFluxResponseWriter
(
exchange
.
getResponse
(),
"请求超过最大数,请稍候再试"
);
}
@Override
...
...
matchtech-gateway/src/main/java/com/matchtech/gateway/service/impl/ValidateCodeServiceImpl.java
View file @
72c20035
...
...
@@ -3,6 +3,8 @@ package com.matchtech.gateway.service.impl;
import
java.awt.image.BufferedImage
;
import
java.io.IOException
;
import
java.util.concurrent.TimeUnit
;
import
com.matchtech.common.core.web.domain.AjaxResult
;
import
jakarta.annotation.Resource
;
import
javax.imageio.ImageIO
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -15,7 +17,6 @@ import com.matchtech.common.core.exception.CaptchaException;
import
com.matchtech.common.core.utils.StringUtils
;
import
com.matchtech.common.core.utils.sign.Base64
;
import
com.matchtech.common.core.utils.uuid.IdUtils
;
import
com.matchtech.common.core.web.domain.AjaxResult
;
import
com.matchtech.common.redis.service.RedisService
;
import
com.matchtech.gateway.config.properties.CaptchaProperties
;
import
com.matchtech.gateway.service.ValidateCodeService
;
...
...
matchtech-gateway/src/main/java/com/matchtech/gateway/utils/WebFluxUtil.java
0 → 100644
View file @
72c20035
package
com
.
matchtech
.
gateway
.
utils
;
import
com.alibaba.fastjson2.JSON
;
import
com.matchtech.common.core.constants.Constants
;
import
com.matchtech.common.core.domain.R
;
import
com.matchtech.common.core.utils.StringUtils
;
import
org.springframework.core.io.buffer.DataBuffer
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.server.reactive.ServerHttpResponse
;
import
reactor.core.publisher.Mono
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLDecoder
;
import
java.net.URLEncoder
;
public
class
WebFluxUtil
{
/**
* 设置webflux模型响应
*
* @param response ServerHttpResponse
* @param value 响应内容
* @return Mono<Void>
*/
public
static
Mono
<
Void
>
webFluxResponseWriter
(
ServerHttpResponse
response
,
Object
value
)
{
return
webFluxResponseWriter
(
response
,
HttpStatus
.
OK
,
value
,
R
.
FAIL
);
}
/**
* 设置webflux模型响应
*
* @param response ServerHttpResponse
* @param code 响应状态码
* @param value 响应内容
* @return Mono<Void>
*/
public
static
Mono
<
Void
>
webFluxResponseWriter
(
ServerHttpResponse
response
,
Object
value
,
int
code
)
{
return
webFluxResponseWriter
(
response
,
HttpStatus
.
OK
,
value
,
code
);
}
/**
* 设置webflux模型响应
*
* @param response ServerHttpResponse
* @param status http状态码
* @param code 响应状态码
* @param value 响应内容
* @return Mono<Void>
*/
public
static
Mono
<
Void
>
webFluxResponseWriter
(
ServerHttpResponse
response
,
HttpStatus
status
,
Object
value
,
int
code
)
{
return
webFluxResponseWriter
(
response
,
MediaType
.
APPLICATION_JSON_VALUE
,
status
,
value
,
code
);
}
/**
* 设置webflux模型响应
*
* @param response ServerHttpResponse
* @param contentType content-type
* @param status http状态码
* @param code 响应状态码
* @param value 响应内容
* @return Mono<Void>
*/
public
static
Mono
<
Void
>
webFluxResponseWriter
(
ServerHttpResponse
response
,
String
contentType
,
HttpStatus
status
,
Object
value
,
int
code
)
{
response
.
setStatusCode
(
status
);
response
.
getHeaders
().
add
(
HttpHeaders
.
CONTENT_TYPE
,
contentType
);
R
<?>
result
=
R
.
fail
(
code
,
value
.
toString
());
DataBuffer
dataBuffer
=
response
.
bufferFactory
().
wrap
(
JSON
.
toJSONString
(
result
).
getBytes
());
return
response
.
writeWith
(
Mono
.
just
(
dataBuffer
));
}
/**
* 内容解码
*
* @param str 内容
* @return 解码后的内容
*/
public
static
String
urlDecode
(
String
str
)
{
try
{
return
URLDecoder
.
decode
(
str
,
Constants
.
UTF8
);
}
catch
(
UnsupportedEncodingException
e
)
{
return
StringUtils
.
EMPTY
;
}
}
/**
* 内容编码
*
* @param str 内容
* @return 编码后的内容
*/
public
static
String
urlEncode
(
String
str
)
{
try
{
return
URLEncoder
.
encode
(
str
,
Constants
.
UTF8
);
}
catch
(
UnsupportedEncodingException
e
)
{
return
StringUtils
.
EMPTY
;
}
}
}
matchtech-modules/matchtech-modules-job/pom.xml
View file @
72c20035
...
...
@@ -67,10 +67,12 @@
<!-- matchtech Common Swagger -->
<dependency>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-swagger
</artifactId>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-openapi3-jakarta-spring-boot-starter
</artifactId>
<version>
4.3.0
</version>
</dependency>
</dependencies>
<build>
...
...
matchtech-modules/matchtech-modules-job/src/main/java/com/matchtech/job/domain/SysJob.java
View file @
72c20035
...
...
@@ -2,7 +2,7 @@ package com.matchtech.job.domain;
import
java.util.Date
;
import
com.matchtech.common.
core
.domain.BaseEntity
;
import
com.matchtech.common.
mybatis
.domain.BaseEntity
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.Size
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
...
...
matchtech-modules/matchtech-modules-job/src/main/java/com/matchtech/job/domain/SysJobLog.java
View file @
72c20035
...
...
@@ -2,7 +2,7 @@ package com.matchtech.job.domain;
import
java.util.Date
;
import
com.matchtech.common.
core
.domain.BaseEntity
;
import
com.matchtech.common.
mybatis
.domain.BaseEntity
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.matchtech.common.core.annotation.Excel
;
...
...
matchtech-modules/matchtech-modules-system/pom.xml
View file @
72c20035
...
...
@@ -66,9 +66,12 @@
</dependency>
<!-- matchtech Common Swagger -->
<!-- knife4j -->
<dependency>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-swagger
</artifactId>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-spring-boot-starter
</artifactId>
<version>
3.0.3
</version>
</dependency>
<dependency>
...
...
matchtech-modules/matchtech-modules-system/src/main/java/com/matchtech/system/controller/SysUserController.java
View file @
72c20035
...
...
@@ -2,15 +2,12 @@ package com.matchtech.system.controller;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.matchtech.common.core.constants.GlobalCodeMessageEnum
;
import
com.matchtech.common.core.domain.R
;
import
com.matchtech.common.core.page.resp.ApiResponseEntity
;
import
com.matchtech.common.core.page.resp.ApiResponseUtils
;
import
com.matchtech.common.dto.constants.GlobalCodeMessageEnum
;
import
com.matchtech.common.dto.page.resp.ApiResponseEntity
;
import
com.matchtech.common.dto.page.resp.ApiResponseUtils
;
import
com.matchtech.common.core.utils.StringUtils
;
import
com.matchtech.common.core.web.controller.BaseController
;
import
com.matchtech.common.dto.BaseIdDto
;
import
com.matchtech.common.dto.login.SysUserDetailVo
;
import
com.matchtech.system.api.domain.SysUser
;
import
com.matchtech.system.api.model.LoginUser
;
import
com.matchtech.system.entity.SysUserEntity
;
import
com.matchtech.system.service.SysUserService
;
...
...
@@ -24,8 +21,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Set
;
@Tag
(
name
=
"系统用户管理"
)
@RestController
@RequestMapping
(
value
=
"${matchtech.adminPath}/sys/user"
)
...
...
matchtech-modules/matchtech-modules-system/src/main/java/com/matchtech/system/entity/SysUserEntity.java
View file @
72c20035
...
...
@@ -2,17 +2,20 @@ package com.matchtech.system.entity;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.matchtech.common.core.constants.Constants
;
import
com.matchtech.common.core.domain.BaseEntity
;
import
com.matchtech.common.mybatis.domain.BaseEntity
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
"sys_user"
)
@Schema
(
description
=
"系统用户"
,
title
=
"系统用户"
)
public
class
SysUserEntity
extends
BaseEntity
{
/**
* 租户ID
*/
@Schema
(
description
=
"租户ID"
)
private
String
tenantId
;
/**
...
...
matchtech-modules/matchtech-modules-system/src/main/java/com/matchtech/system/mapper/SysEmployeeMapper.java
View file @
72c20035
package
com
.
matchtech
.
system
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.matchtech.common.
core.
mybatis.BaseMapperX
;
import
com.matchtech.common.mybatis.BaseMapperX
;
import
com.matchtech.system.entity.SysEmployeeEntity
;
import
org.apache.ibatis.annotations.Mapper
;
...
...
matchtech-modules/matchtech-modules-system/src/main/java/com/matchtech/system/mapper/SysUserMapper.java
View file @
72c20035
package
com
.
matchtech
.
system
.
mapper
;
import
com.matchtech.common.
core.
mybatis.BaseMapperX
;
import
com.matchtech.common.mybatis.BaseMapperX
;
import
com.matchtech.system.entity.SysUserEntity
;
import
org.apache.ibatis.annotations.Mapper
;
...
...
matchtech-modules/matchtech-modules-system/src/main/java/com/matchtech/system/service/SysUserService.java
View file @
72c20035
...
...
@@ -9,13 +9,13 @@ import com.matchtech.common.core.config.MatchtechProperties;
import
com.matchtech.common.core.constants.Constants
;
import
com.matchtech.common.core.constants.GlobalCodeMessageEnum
;
import
com.matchtech.common.core.exception.GlobalException
;
import
com.matchtech.common.core.utils.ip.IpUtils
;
import
com.matchtech.common.core.utils.sign.DigestUtils
;
import
com.matchtech.common.core.utils.sign.RsaUtil
;
import
com.matchtech.common.dto.login.SysLoginVo
;
import
com.matchtech.common.redis.constant.RedisConstants
;
import
com.matchtech.common.redis.service.RedisUtils
;
import
com.matchtech.common.security.service.TokenService
;
import
com.matchtech.common.servlet.utils.ip.IpUtils
;
import
com.matchtech.system.convertors.SysUserConvertor
;
import
com.matchtech.common.dto.login.SysLoginDto
;
import
com.matchtech.system.entity.SysUserEntity
;
...
...
matchtech-modules/matchtech-modules-system/src/main/resources/bootstrap.yml
View file @
72c20035
...
...
@@ -27,3 +27,20 @@ spring:
extension-configs
:
-
data-id
:
matchtech-system-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
refresh
:
true
# springdoc配置
springdoc
:
gatewayUrl
:
http://localhost:9999/${spring.application.name}
api-docs
:
# 是否开启接口文档
enabled
:
true
info
:
# 标题
title
:
'
系统模块接口文档'
# 描述
description
:
'
系统模块接口描述'
# 作者信息
contact
:
name
:
matchtech
url
:
${spring.application.name}
\ No newline at end of file
pom.xml
View file @
72c20035
...
...
@@ -202,12 +202,12 @@
<version>
${matchtech.version}
</version>
</dependency>
<!-- 接口模块
-->
<dependency
>
<groupId>
com.matchtech
</groupId
>
<artifactId>
matchtech-common-swagger
</artifactId
>
<version>
${matchtech.version}
</version
>
</dependency
>
<!-- <!– 接口模块 –>
-->
<!-- <dependency>--
>
<!-- <groupId>com.matchtech</groupId>--
>
<!-- <artifactId>matchtech-common-swagger</artifactId>--
>
<!-- <version>${matchtech.version}</version>--
>
<!-- </dependency>--
>
<!-- 安全模块 -->
<dependency>
...
...
@@ -283,6 +283,20 @@
<version>
2.2.20
</version>
</dependency>
<!-- 核心模块 -->
<dependency>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-mybatis
</artifactId>
<version>
${matchtech.version}
</version>
</dependency>
<!-- 核心模块 -->
<dependency>
<groupId>
com.matchtech
</groupId>
<artifactId>
matchtech-common-servlet
</artifactId>
<version>
${matchtech.version}
</version>
</dependency>
</dependencies>
</dependencyManagement>
...
...
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