mirror of
https://gitee.com/republicline/rax-remote-v2.git
synced 2025-08-24 04:04:57 +08:00
fix: v2期
This commit is contained in:
parent
ef57152bfb
commit
1add5ac60e
|
@ -132,6 +132,11 @@
|
||||||
<groupId>cn.hutool</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
<artifactId>hutool-core</artifactId>
|
<artifactId>hutool-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mongodb</groupId>
|
||||||
|
<artifactId>mongo-java-driver</artifactId>
|
||||||
|
<version>3.12.14</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -23,7 +23,6 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
@Service
|
|
||||||
public class LogTimerTask {
|
public class LogTimerTask {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.rax.admin.timmer;
|
||||||
|
|
||||||
|
import com.mongodb.client.MongoClient;
|
||||||
|
import com.mongodb.client.MongoClients;
|
||||||
|
import com.mongodb.client.MongoDatabase;
|
||||||
|
import com.mongodb.client.MongoIterable;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.aspectj.weaver.ast.Var;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @project_name: rax-remote-v2
|
||||||
|
* @time: 2024/10/8 10:57
|
||||||
|
* @author: republicline
|
||||||
|
* @description: mongoDB定时备份
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class MongoTimer {
|
||||||
|
String connectionString = "mongodb://localhost:27017";
|
||||||
|
MongoClient mongoClient = MongoClients.create(connectionString);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void backup() {
|
||||||
|
MongoIterable<String> DbNames = mongoClient.listDatabaseNames();
|
||||||
|
for (String dbName : DbNames) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.rax.admin.timmer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @project_name: rax-remote-v2
|
||||||
|
* @time: 2024/10/8 10:57
|
||||||
|
* @author: republicline
|
||||||
|
* @description: mysql定时备份
|
||||||
|
*/
|
||||||
|
public class MySqlTimer {
|
||||||
|
}
|
|
@ -44,6 +44,13 @@ public class WebSocketInterceptors implements HandshakeInterceptor {
|
||||||
@Override
|
@Override
|
||||||
public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception {
|
public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception {
|
||||||
String query = request.getURI().getQuery();
|
String query = request.getURI().getQuery();
|
||||||
|
if (query == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Map<String, String> params = GetHttpParamUtil.getParams(query);
|
||||||
|
if (!params.containsKey("token")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
String token = GetHttpParamUtil.getParam(query, "token");
|
String token = GetHttpParamUtil.getParam(query, "token");
|
||||||
OAuth2Authorization authorization = authorizationService.findByToken(token, OAuth2TokenType.ACCESS_TOKEN);
|
OAuth2Authorization authorization = authorizationService.findByToken(token, OAuth2TokenType.ACCESS_TOKEN);
|
||||||
if (authorization == null) {
|
if (authorization == null) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user