fix: v2期

This commit is contained in:
republicline 2024-10-08 11:50:12 +08:00
parent ef57152bfb
commit 1add5ac60e
5 changed files with 53 additions and 1 deletions

View File

@ -132,6 +132,11 @@
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.12.14</version>
</dependency>
</dependencies>
<build>

View File

@ -23,7 +23,6 @@ import java.util.List;
*/
@Slf4j
@Component
@Service
public class LogTimerTask {
@Autowired

View File

@ -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) {
}
}
}

View File

@ -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 {
}

View File

@ -44,6 +44,13 @@ public class WebSocketInterceptors implements HandshakeInterceptor {
@Override
public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception {
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");
OAuth2Authorization authorization = authorizationService.findByToken(token, OAuth2TokenType.ACCESS_TOKEN);
if (authorization == null) {