Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<p align="center">
<img src='https://img.shields.io/github/license/matevip/matecloud' alt='License'/>
<img src="https://img.shields.io/github/stars/matevip/matecloud" alt="Stars"/>
<img src="https://img.shields.io/badge/Spring%20Boot-2.3.4.RELEASE-green" alt="SpringBoot"/>
<img src="https://img.shields.io/badge/Spring%20Boot-2.3.5.RELEASE-green" alt="SpringBoot"/>
<img src="https://img.shields.io/badge/Spring%20Cloud-Hoxton.SR8-blue" alt="SpringCloud"/>
<img src="https://img.shields.io/badge/Spring%20Cloud%20Alibaba-2.2.3.RELEASE-brightgreen" alt="Spring Cloud Alibaba"/>
</p>
Expand Down Expand Up @@ -34,7 +34,7 @@ QQ群:2003638
</p>

### 功能特点
- 主体框架:采用最新的Spring Cloud Hoxton SR8, Spring Boot 2.3.4.RELEASE, Spring Cloud Alibaba 2.2.3.RELEASE版本进行系统设计;
- 主体框架:采用最新的Spring Cloud Hoxton SR8, Spring Boot 2.3.5.RELEASE, Spring Cloud Alibaba 2.2.3.RELEASE版本进行系统设计;

- 统一注册:支持nacos作为注册中心,实现多配置、分群组、分命名空间、多业务模块的注册和发现功能;

Expand Down
8 changes: 7 additions & 1 deletion doc/nacos/mate-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ mate:
preview:
enable: false
tenant:
enable: false
enable: false
uaa:
enable: false
ignore-url:
- /auth/login/**
- /auth/callback/**
- /auth/sms-code
6 changes: 6 additions & 0 deletions doc/nacos/mate-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ mate:
enable: false
tenant:
enable: false
uaa:
enable: false
ignore-url:
- /auth/login/**
- /auth/callback/**
- /auth/sms-code
6 changes: 6 additions & 0 deletions doc/nacos/mate-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ mate:
enable: false
tenant:
enable: false
uaa:
enable: false
ignore-url:
- /auth/login/**
- /auth/callback/**
- /auth/sms-code
6 changes: 6 additions & 0 deletions doc/nacos/mate-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ mate:
enable: false
tenant:
enable: false
uaa:
enable: false
ignore-url:
- /auth/login/**
- /auth/callback/**
- /auth/sms-code
2 changes: 1 addition & 1 deletion mate-core/mate-starter-auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.3.8</version>
<version>1.5.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-cloud/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.3.8</version>
<version>1.5.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package vip.mate.core.cloud.props;

import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
* 验证权限配置
*
* @author pangu
* @date 2020-10-28
*/
@Setter
@RefreshScope
@ConfigurationProperties(prefix = "mate.uaa")
public class MateUaaProperties {

/**
* 忽略URL,List列表形式
*/
private List<String> ignoreUrl = new ArrayList<>();

/**
* 是否启用网关鉴权模式
*/
private Boolean enable = false;

/**
* 监控中心和swagger需要访问的url
*/
private static final String[] ENDPOINTS = {
"/oauth/**",
"/actuator/**",
"/v2/api-docs/**",
"/v2/api-docs-ext/**",
"/swagger/api-docs",
"/swagger-ui.html",
"/doc.html",
"/swagger-resources/**",
"/webjars/**",
"/druid/**",
"/error/**",
"/assets/**",
"/auth/logout",
"/auth/code"
};

/**
* 自定义getter方法,并将ENDPOINTS加入至忽略URL列表
* @return List
*/
public List<String> getIgnoreUrl() {
if (!ignoreUrl.contains("/doc.html")) {
Collections.addAll(ignoreUrl, ENDPOINTS);
}
return ignoreUrl;
}

public Boolean getEnable() {
return enable;
}
}
2 changes: 1 addition & 1 deletion mate-core/mate-starter-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.3.8</version>
<version>1.5.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class MateConstant {
/**
* 应用版本号
*/
public static final String MATE_APP_VERSION = "1.3.8";
public static final String MATE_APP_VERSION = "1.5.8";

/**
* Spring 应用名 prop key
Expand Down Expand Up @@ -74,5 +74,10 @@ public class MateConstant {
*/
public static final String MATE_API_RESOURCE = "mate-api-resource";

/**
* 权限认证的排序
*/
public static final int MATE_UAA_FILTER_ORDER = -200;


}
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package vip.mate.core.common.exception;

/**
* Token处理异常
*
* @author xuzhanfu
*/
public class TokenException extends RuntimeException {

private static final long serialVersionUID = -109638013567525177L;
private static final long serialVersionUID = -109638013567525177L;

public TokenException(String message) {
super(message);
}
public TokenException(String message) {
super(message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,49 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.server.reactive.ServerHttpResponse;
import reactor.core.publisher.Mono;
import vip.mate.core.common.api.Result;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
* 响应工具
*
* @author pangu
*/
public class ResponseUtil {

/**
* 设置响应
*
* @param response HttpServletResponse
* @param contentType content-type
* @param status http状态码
* @param value 响应内容
* @throws IOException IOException
*/
public static void responseWriter(HttpServletResponse response, String contentType,
int status, Object value) throws IOException {
response.setContentType(contentType);
response.setStatus(status);
response.getOutputStream().write(JSONObject.toJSONString(value).getBytes());
}
/**
* 设置响应
*
* @param response HttpServletResponse
* @param contentType content-type
* @param status http状态码
* @param value 响应内容
* @throws IOException IOException
*/
public static void responseWriter(HttpServletResponse response, String contentType,
int status, Object value) throws IOException {
response.setContentType(contentType);
response.setStatus(status);
response.getOutputStream().write(JSONObject.toJSONString(value).getBytes());
}

/**
* 设置webflux模型响应
*
* @param response ServerHttpResponse
* @param contentType content-type
* @param status http状态码
* @param value 响应内容
* @return Mono<Void>
*/
public static Mono<Void> webFluxResponseWriter(ServerHttpResponse response, String contentType,
HttpStatus status, Object value) {
response.setStatusCode(status);
response.getHeaders().add(HttpHeaders.CONTENT_TYPE, contentType);
DataBuffer dataBuffer = response.bufferFactory().wrap(JSONObject.toJSONString(value).getBytes());
return response.writeWith(Mono.just(dataBuffer));
}
/**
* 设置webflux模型响应
*
* @param response ServerHttpResponse
* @param contentType content-type
* @param status http状态码
* @param value 响应内容
* @return Mono<Void>
*/
public static Mono<Void> webFluxResponseWriter(ServerHttpResponse response, String contentType,
HttpStatus status, Object value) {
response.setStatusCode(status);
response.getHeaders().add(HttpHeaders.CONTENT_TYPE, contentType);
Result<?> result = Result.fail(status.value(), value.toString());
DataBuffer dataBuffer = response.bufferFactory().wrap(JSONObject.toJSONString(result).getBytes());
return response.writeWith(Mono.just(dataBuffer));
}
}
2 changes: 1 addition & 1 deletion mate-core/mate-starter-database/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.3.8</version>
<version>1.5.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
10 changes: 5 additions & 5 deletions mate-core/mate-starter-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.4.RELEASE</version>
<version>2.3.5.RELEASE</version>
<relativePath />
</parent>
<modelVersion>4.0.0</modelVersion>

<groupId>vip.mate</groupId>
<artifactId>mate-starter-dependencies</artifactId>
<version>1.3.8</version>
<version>1.5.8</version>
<packaging>pom</packaging>
<description>MateCloud统一版本依赖</description>

<properties>
<matecloud.core.version>1.3.8</matecloud.core.version>
<matecloud.core.version>1.5.8</matecloud.core.version>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>

<spring.boot.version>2.3.4.RELEASE</spring.boot.version>
<spring.boot.version>2.3.5.RELEASE</spring.boot.version>
<spring.cloud.version>Hoxton.SR8</spring.cloud.version>
<alibaba.cloud.version>2.2.3.RELEASE</alibaba.cloud.version>

Expand Down Expand Up @@ -67,7 +67,7 @@
<commons-collections.version>3.2.2</commons-collections.version>

<dozer.version>6.5.0</dozer.version>
<redisson.version>3.13.3</redisson.version>
<redisson.version>3.13.6</redisson.version>
<lettuce.version>5.3.3.RELEASE</lettuce.version>
<sentinel.version>1.8.0</sentinel.version>
<transmittable.version>2.11.5</transmittable.version>
Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-dozer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.3.8</version>
<version>1.5.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mate-core/mate-starter-dubbo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.3.8</version>
<version>1.5.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@Configuration
@ConditionalOnProperty(prefix = DUBBO_PREFIX, name = "enabled", matchIfMissing = true, havingValue = "true")
@ConditionalOnClass(AbstractConfig.class)
public class DubboFeignAutoConfiguration {
public class DubboFeignConfiguration {

@ConditionalOnProperty(prefix = DUBBO_SCAN_PREFIX, name = BASE_PACKAGES_PROPERTY_NAME)
@ConditionalOnClass(ConfigurationPropertySources.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
vip.mate.core.dubbo.config.DubboFeignAutoConfiguration
vip.mate.core.dubbo.config.DubboFeignConfiguration

2 changes: 1 addition & 1 deletion mate-core/mate-starter-elasticsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.3.8</version>
<version>1.5.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
33 changes: 33 additions & 0 deletions mate-core/mate-starter-encrypt/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.5.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>mate-starter-encrypt</artifactId>

<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>


</project>
Loading