Commit 38183110 authored by matevip's avatar matevip Committed by Gitee
Browse files

!1 1.2.8

Merge pull request !1 from matevip/dev
parents 8a15f8dc e5872104
Showing with 804 additions and 508 deletions
+804 -508
......@@ -25,29 +25,4 @@ mate:
preview:
enable: false
tenant:
enable: false
jetcache:
remote:
default:
type: redis.lettuce
keyConvertor: fastjson
uri: redis://127.0.0.1:6379/
justauth:
enabled: true
type:
github:
client-id: 75a51afd3b0a2fc32952
client-secret: dcf425ac897106e**********8b336d2317b
redirect-uri: http://localhost:10001/mate-uaa/auth/callback/github
wechat_open:
client-id: wxdcb******4ff4
client-secret: b4e9dc************************a08ed6d
redirect-uri: http://oauth.xkcoding.com/demo/oauth/wechat/callback
cache:
type: redis
prefix: 'SOCIAL::STATE::'
timeout: 1h
social:
vue:
url: http://localhost:9528/#/socialcallback
enable: false
\ No newline at end of file
......@@ -26,28 +26,3 @@ mate:
enable: false
tenant:
enable: false
jetcache:
remote:
default:
type: redis.lettuce
keyConvertor: fastjson
uri: redis://127.0.0.1:6379/
justauth:
enabled: true
type:
github:
client-id: 75a51afd3b0a2fc32952
client-secret: dcf425ac897106e**********8b336d2317b
redirect-uri: http://localhost:10001/mate-uaa/auth/callback/github
wechat_open:
client-id: wxdcb******4ff4
client-secret: b4e9dc************************a08ed6d
redirect-uri: http://oauth.xkcoding.com/demo/oauth/wechat/callback
cache:
type: redis
prefix: 'SOCIAL::STATE::'
timeout: 1h
social:
vue:
url: http://localhost:9528/#/socialcallback
......@@ -26,28 +26,3 @@ mate:
enable: false
tenant:
enable: false
jetcache:
remote:
default:
type: redis.lettuce
keyConvertor: fastjson
uri: redis://127.0.0.1:6379/
justauth:
enabled: true
type:
github:
client-id: 75a51afd3b0a2fc32952
client-secret: dcf425ac897106e**********8b336d2317b
redirect-uri: http://localhost:10001/mate-uaa/auth/callback/github
wechat_open:
client-id: wxdcb******4ff4
client-secret: b4e9dc************************a08ed6d
redirect-uri: http://oauth.xkcoding.com/demo/oauth/wechat/callback
cache:
type: redis
prefix: 'SOCIAL::STATE::'
timeout: 1h
social:
vue:
url: http://localhost:9528/#/socialcallback
......@@ -26,28 +26,3 @@ mate:
enable: false
tenant:
enable: false
jetcache:
remote:
default:
type: redis.lettuce
keyConvertor: fastjson
uri: redis://127.0.0.1:6379/
justauth:
enabled: true
type:
github:
client-id: 75a51afd3b0a2fc32952
client-secret: dcf425ac897106e**********8b336d2317b
redirect-uri: http://localhost:10001/mate-uaa/auth/callback/github
wechat_open:
client-id: wxdcb******4ff4
client-secret: b4e9dc************************a08ed6d
redirect-uri: http://oauth.xkcoding.com/demo/oauth/wechat/callback
cache:
type: redis
prefix: 'SOCIAL::STATE::'
timeout: 1h
social:
vue:
url: http://localhost:9528/#/socialcallback
[
{
"id": "component",
"order": 0,
"predicates": [
{
"name": "Path",
"args": {
"pattern": "/mate-component/**"
}
}
],
"filters": [],
"uri": "lb://mate-component"
},
{
"id": "path_route",
"order": 1,
"predicates": [{
"name": "Path",
"args": {
"pattern": "/get"
}
}],
"filters": [],
"uri": "https://www.baidu.com"
}
]
This diff is collapsed.
#
# XXL-JOB v2.2.1-SNAPSHOT
# Copyright (c) 2015-present, xuxueli.
CREATE database if NOT EXISTS `xxl_job` default character set utf8mb4 collate utf8mb4_unicode_ci;
use `xxl_job`;
SET NAMES utf8mb4;
CREATE TABLE `xxl_job_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`job_group` int(11) NOT NULL COMMENT '执行器主键ID',
`job_cron` varchar(128) NOT NULL COMMENT '任务执行CRON',
`job_desc` varchar(255) NOT NULL,
`add_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
`author` varchar(64) DEFAULT NULL COMMENT '作者',
`alarm_email` varchar(255) DEFAULT NULL COMMENT '报警邮件',
`executor_route_strategy` varchar(50) DEFAULT NULL COMMENT '执行器路由策略',
`executor_handler` varchar(255) DEFAULT NULL COMMENT '执行器任务handler',
`executor_param` varchar(512) DEFAULT NULL COMMENT '执行器任务参数',
`executor_block_strategy` varchar(50) DEFAULT NULL COMMENT '阻塞处理策略',
`executor_timeout` int(11) NOT NULL DEFAULT '0' COMMENT '任务执行超时时间,单位秒',
`executor_fail_retry_count` int(11) NOT NULL DEFAULT '0' COMMENT '失败重试次数',
`glue_type` varchar(50) NOT NULL COMMENT 'GLUE类型',
`glue_source` mediumtext COMMENT 'GLUE源代码',
`glue_remark` varchar(128) DEFAULT NULL COMMENT 'GLUE备注',
`glue_updatetime` datetime DEFAULT NULL COMMENT 'GLUE更新时间',
`child_jobid` varchar(255) DEFAULT NULL COMMENT '子任务ID,多个逗号分隔',
`trigger_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '调度状态:0-停止,1-运行',
`trigger_last_time` bigint(13) NOT NULL DEFAULT '0' COMMENT '上次调度时间',
`trigger_next_time` bigint(13) NOT NULL DEFAULT '0' COMMENT '下次调度时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `xxl_job_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`job_group` int(11) NOT NULL COMMENT '执行器主键ID',
`job_id` int(11) NOT NULL COMMENT '任务,主键ID',
`executor_address` varchar(255) DEFAULT NULL COMMENT '执行器地址,本次执行的地址',
`executor_handler` varchar(255) DEFAULT NULL COMMENT '执行器任务handler',
`executor_param` varchar(512) DEFAULT NULL COMMENT '执行器任务参数',
`executor_sharding_param` varchar(20) DEFAULT NULL COMMENT '执行器任务分片参数,格式如 1/2',
`executor_fail_retry_count` int(11) NOT NULL DEFAULT '0' COMMENT '失败重试次数',
`trigger_time` datetime DEFAULT NULL COMMENT '调度-时间',
`trigger_code` int(11) NOT NULL COMMENT '调度-结果',
`trigger_msg` text COMMENT '调度-日志',
`handle_time` datetime DEFAULT NULL COMMENT '执行-时间',
`handle_code` int(11) NOT NULL COMMENT '执行-状态',
`handle_msg` text COMMENT '执行-日志',
`alarm_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '告警状态:0-默认、1-无需告警、2-告警成功、3-告警失败',
PRIMARY KEY (`id`),
KEY `I_trigger_time` (`trigger_time`),
KEY `I_handle_code` (`handle_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `xxl_job_log_report` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`trigger_day` datetime DEFAULT NULL COMMENT '调度-时间',
`running_count` int(11) NOT NULL DEFAULT '0' COMMENT '运行中-日志数量',
`suc_count` int(11) NOT NULL DEFAULT '0' COMMENT '执行成功-日志数量',
`fail_count` int(11) NOT NULL DEFAULT '0' COMMENT '执行失败-日志数量',
PRIMARY KEY (`id`),
UNIQUE KEY `i_trigger_day` (`trigger_day`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `xxl_job_logglue` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`job_id` int(11) NOT NULL COMMENT '任务,主键ID',
`glue_type` varchar(50) DEFAULT NULL COMMENT 'GLUE类型',
`glue_source` mediumtext COMMENT 'GLUE源代码',
`glue_remark` varchar(128) NOT NULL COMMENT 'GLUE备注',
`add_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `xxl_job_registry` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`registry_group` varchar(50) NOT NULL,
`registry_key` varchar(255) NOT NULL,
`registry_value` varchar(255) NOT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `i_g_k_v` (`registry_group`,`registry_key`,`registry_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `xxl_job_group` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`app_name` varchar(64) NOT NULL COMMENT '执行器AppName',
`title` varchar(12) NOT NULL COMMENT '执行器名称',
`address_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '执行器地址类型:0=自动注册、1=手动录入',
`address_list` varchar(512) DEFAULT NULL COMMENT '执行器地址列表,多地址逗号分隔',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `xxl_job_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL COMMENT '账号',
`password` varchar(50) NOT NULL COMMENT '密码',
`role` tinyint(4) NOT NULL COMMENT '角色:0-普通用户、1-管理员',
`permission` varchar(255) DEFAULT NULL COMMENT '权限:执行器ID列表,多个逗号分割',
PRIMARY KEY (`id`),
UNIQUE KEY `i_username` (`username`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `xxl_job_lock` (
`lock_name` varchar(50) NOT NULL COMMENT '锁名称',
PRIMARY KEY (`lock_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `xxl_job_group`(`id`, `app_name`, `title`, `address_type`, `address_list`) VALUES (1, 'xxl-job-executor-sample', '示例执行器', 0, NULL);
INSERT INTO `xxl_job_info`(`id`, `job_group`, `job_cron`, `job_desc`, `add_time`, `update_time`, `author`, `alarm_email`, `executor_route_strategy`, `executor_handler`, `executor_param`, `executor_block_strategy`, `executor_timeout`, `executor_fail_retry_count`, `glue_type`, `glue_source`, `glue_remark`, `glue_updatetime`, `child_jobid`) VALUES (1, 1, '0 0 0 * * ? *', '测试任务1', '2018-11-03 22:21:31', '2018-11-03 22:21:31', 'XXL', '', 'FIRST', 'demoJobHandler', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化', '2018-11-03 22:21:31', '');
INSERT INTO `xxl_job_user`(`id`, `username`, `password`, `role`, `permission`) VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 1, NULL);
INSERT INTO `xxl_job_lock` ( `lock_name`) VALUES ( 'schedule_lock');
commit;
......@@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.1.8</version>
<version>1.2.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......@@ -24,5 +24,4 @@
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -2,6 +2,12 @@ package vip.mate.core.auth.annotation;
import java.lang.annotation.*;
/**
* 启用Token验证
*
* @author pangu
*/
@Deprecated
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
......
package vip.mate.core.auth.annotation;
import java.lang.annotation.*;
/**
* URL权限注解
*
* @author pangu
*/
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface PreAuth {
/**
* 是否启用
* @return boolean
*/
boolean enabled() default true;
/**
* 验证用户是否授权
* @return String
*/
String hasPerm() default "";
}
package vip.mate.core.auth.aspect;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.util.PatternMatchUtils;
import org.springframework.util.StringUtils;
import vip.mate.core.auth.annotation.PreAuth;
import vip.mate.core.common.constant.Oauth2Constant;
import vip.mate.core.common.entity.LoginUser;
import vip.mate.core.common.exception.TokenException;
import vip.mate.core.common.util.SecurityUtil;
import vip.mate.core.common.util.StringPool;
import vip.mate.core.redis.core.RedisService;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* 自定义权限验证
*
* @author pangu
*/
@Slf4j
@Aspect
@Component
@AllArgsConstructor
public class PreAuthAspect {
/**
* 所有权限标识
*/
private static final String ALL_PERMISSION = "*:*:*";
private final HttpServletRequest request;
private final RedisService redisService;
@Around("@annotation(vip.mate.core.auth.annotation.PreAuth)")
public Object around(ProceedingJoinPoint point) throws Throwable {
Signature signature = point.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
Method method = methodSignature.getMethod();
PreAuth preAuth = method.getAnnotation(PreAuth.class);
if (ObjectUtils.isEmpty(preAuth)) {
return point.proceed();
}
if (hasPerm(preAuth.hasPerm())) {
return point.proceed();
} else {
throw new TokenException("权限验证不通过");
}
}
/**
* 验证用户是否具备某权限
*
* @param permission 权限字符串
* @return 用户是否具备某权限
*/
public boolean hasPerm(String permission) {
LoginUser userInfo = SecurityUtil.getUsername(request);
if (StringUtils.isEmpty(userInfo)) {
return false;
}
if (!StringUtils.isEmpty(userInfo) && StringUtils.isEmpty(permission)) {
return true;
}
// 如果用户是超级管理员,则直接跳过权限验证
if (userInfo.getAccount().equalsIgnoreCase(Oauth2Constant.SUPER_ADMIN)) {
return true;
}
Map<String, Object> data = (Map<String, Object>) redisService.get(Oauth2Constant.MATE_PERMISSION_PREFIX
+ userInfo.getAccount() + StringPool.DOT + userInfo.getRoleId());
List<String> authorities = (List<String>) data.get("permissions");
return hasPermissions(authorities, permission);
}
/**
* 判断是否包含权限
*
* @param authorities 权限列表
* @param permission 权限字符串
* @return 用户是否具备某权限
*/
private boolean hasPermissions(Collection<String> authorities, String permission) {
return authorities.stream().filter(StringUtils::hasText)
.anyMatch(x -> ALL_PERMISSION.contains(x) || PatternMatchUtils.simpleMatch(permission, x));
}
}
......@@ -12,32 +12,33 @@ import javax.servlet.http.HttpServletRequest;
/**
* token验证切面
*
* @author xuzhanfu
*/
@Deprecated
@Slf4j
@Aspect
@Component
@AllArgsConstructor
public class TokenAspect {
private final HttpServletRequest request;
private final HttpServletRequest request;
/**
* 定义切入点,切入点为标注自定义注解TokenAnnotation的方法
*通过@Pointcut注解声明频繁使用的切点表达式
*/
@Pointcut("@annotation(vip.mate.core.auth.annotation.EnableToken)")
public void TokenAspectPointcut(){
/**
* 定义切入点,切入点为标注自定义注解TokenAnnotation的方法
* 通过@Pointcut注解声明频繁使用的切点表达式
*/
@Pointcut("@annotation(vip.mate.core.auth.annotation.EnableToken)")
public void tokenAspectPointcut() {
}
}
/**
* 定义切入点,切入点为标注自定义注解TokenAnnotation的方法
*通过@Pointcut注解声明频繁使用的切点表达式
*/
@Before("TokenAspectPointcut()")
public void before() throws Exception{
// tokenService.checkToken(request);// 幂等性校验, 校验通过则放行, 校验失败则抛出异常, 并通过统一异常处理返回友好提示
SecurityUtil.getClaims(SecurityUtil.getToken(request));
}
/**
* 定义切入点,切入点为标注自定义注解TokenAnnotation的方法
* 通过@Pointcut注解声明频繁使用的切点表达式
*/
@Before("tokenAspectPointcut()")
public void before() {
SecurityUtil.getClaims(SecurityUtil.getToken(request));
}
}
......@@ -6,8 +6,13 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import vip.mate.core.auth.props.TokenProperties;
/**
* Token配置
*
* @author pangu
*/
@Configuration
@ComponentScan(value="vip.mate.core.auth")
@ComponentScan(value = "vip.mate.core.auth")
@EnableConfigurationProperties(TokenProperties.class)
@ConditionalOnProperty(value = TokenProperties.PREFIX + ".enabled", havingValue = "true", matchIfMissing = true)
public class TokenConfiguration {
......
......@@ -4,18 +4,23 @@ import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Token属性
*
* @author pangu
*/
@Getter
@Setter
@ConfigurationProperties(TokenProperties.PREFIX)
public class TokenProperties {
/**
* 前缀
*/
public static final String PREFIX = "mate.token.auth";
/**
* 前缀
*/
public static final String PREFIX = "mate.token.auth";
/**
* 是否开启token验证
*/
private Boolean enable = Boolean.TRUE;
/**
* 是否开启token验证
*/
private Boolean enable = Boolean.TRUE;
}
......@@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.1.8</version>
<version>1.2.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......@@ -54,6 +54,10 @@
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-kotlin</artifactId>
</dependency>
</dependencies>
......
package vip.mate.core.cloud.nacos;
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
import com.alibaba.cloud.nacos.NacosServiceManager;
import com.alibaba.nacos.api.exception.NacosException;
import com.alibaba.nacos.api.naming.NamingService;
import com.alibaba.nacos.api.naming.listener.Event;
import com.alibaba.nacos.api.naming.listener.EventListener;
import com.alibaba.nacos.api.naming.listener.NamingEvent;
import com.alibaba.nacos.api.naming.pojo.Instance;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.cloud.client.discovery.event.HeartbeatEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.context.SmartLifecycle;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
/**
* @author xiaojing
* @author yuhuangbin
*/
public class NacosWatch implements ApplicationEventPublisherAware, SmartLifecycle, DisposableBean {
private static final Logger log = LoggerFactory.getLogger(NacosWatch.class);
private Map<String, EventListener> listenerMap = new ConcurrentHashMap<>(16);
private final AtomicBoolean running = new AtomicBoolean(false);
private final AtomicLong nacosWatchIndex = new AtomicLong(0);
private ApplicationEventPublisher publisher;
private ScheduledFuture<?> watchFuture;
private NacosServiceManager nacosServiceManager;
private final NacosDiscoveryProperties properties;
private final TaskScheduler taskScheduler;
public NacosWatch(NacosServiceManager nacosServiceManager,
NacosDiscoveryProperties properties,
ObjectProvider<TaskScheduler> taskScheduler) {
this.nacosServiceManager = nacosServiceManager;
this.properties = properties;
this.taskScheduler = taskScheduler.getIfAvailable(NacosWatch::getTaskScheduler);
}
private static ThreadPoolTaskScheduler getTaskScheduler() {
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
taskScheduler.setBeanName("Nacos-Watch-Task-Scheduler");
taskScheduler.initialize();
return taskScheduler;
}
@Override
public void setApplicationEventPublisher(ApplicationEventPublisher publisher) {
this.publisher = publisher;
}
@Override
public boolean isAutoStartup() {
return true;
}
@Override
public void start() {
if (this.running.compareAndSet(false, true)) {
EventListener eventListener = listenerMap.computeIfAbsent(buildKey(),
event -> new EventListener() {
@Override
public void onEvent(Event event) {
if (event instanceof NamingEvent) {
List<Instance> instances = ((NamingEvent) event)
.getInstances();
Optional<Instance> instanceOptional = selectCurrentInstance(
instances);
instanceOptional.ifPresent(currentInstance -> {
resetIfNeeded(currentInstance);
});
}
}
});
NamingService namingService = nacosServiceManager
.getNamingService(properties.getNacosProperties());
try {
namingService.subscribe(properties.getService(), properties.getGroup(),
Collections.singletonList(properties.getClusterName()), eventListener);
} catch (Exception e) {
log.error("namingService subscribe failed, properties:{}", properties, e);
}
this.watchFuture = this.taskScheduler.scheduleWithFixedDelay(
this::nacosServicesWatch, this.properties.getWatchDelay());
}
}
private String buildKey() {
return String.join(":", properties.getService(), properties.getGroup());
}
private void resetIfNeeded(Instance instance) {
if (!properties.getMetadata().equals(instance.getMetadata())) {
properties.setMetadata(instance.getMetadata());
}
}
private Optional<Instance> selectCurrentInstance(List<Instance> instances) {
return instances.stream()
.filter(instance -> properties.getIp().equals(instance.getIp())
&& properties.getPort() == instance.getPort())
.findFirst();
}
@Override
public void stop() {
if (this.running.compareAndSet(true, false)) {
if (this.watchFuture != null) {
// shutdown current user-thread,
// then the other daemon-threads will terminate automatic.
((ThreadPoolTaskScheduler) this.taskScheduler).shutdown();
this.watchFuture.cancel(true);
}
}
}
@Override
public void destroy() throws Exception {
EventListener eventListener = listenerMap.get(buildKey());
try {
NamingService namingService = nacosServiceManager
.getNamingService(properties.getNacosProperties());
namingService.unsubscribe(properties.getService(), properties.getGroup(),
Collections.singletonList(properties.getClusterName()), eventListener);
nacosServiceManager.nacosServiceShutDown();
} catch (NacosException e) {
log.error("namingService unsubscribe failed, properties:{}", properties, e);
}
}
@Override
public boolean isRunning() {
return this.running.get();
}
@Override
public int getPhase() {
return 0;
}
public void nacosServicesWatch() {
// nacos doesn't support watch now , publish an event every 30 seconds.
this.publisher.publishEvent(new HeartbeatEvent(this, nacosWatchIndex.getAndIncrement()));
}
}
......@@ -21,6 +21,8 @@ spring:
discovery:
namespace: @config.namespace@
server-addr: @config.server-addr@
watch:
enabled: false
sentinel:
# 是否开启sentinel
enabled: true
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>mate-core</artifactId>
<groupId>vip.mate</groupId>
<version>1.1.8</version>
<version>1.2.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -8,7 +8,7 @@ public class MateConstant {
/**
* 应用版本号
*/
public static final String MATE_APP_VERSION = "1.1.8";
public static final String MATE_APP_VERSION = "1.2.8";
/**
* Spring 应用名 prop key
......
......@@ -116,6 +116,8 @@ public class Oauth2Constant {
public static final String CAPTCHA_ERROR = "验证码不正确!";
public static final String SUPER_ADMIN = "admin";
/**
* 基础查询语句
*/
......@@ -127,7 +129,16 @@ public class Oauth2Constant {
public static final String SELECT_CLIENT_DETAIL_SQL = CLIENT_BASE + " where client_id = ?";
/**
* 标志
*/
public static final String FROM = "from";
/**
* 内部
*/
public static final String FROM_IN = "Y";
public static final String MATE_PERMISSION_PREFIX = "mate.permission.";
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment