fix: 修复依赖问题

This commit is contained in:
2025-11-20 00:33:27 +08:00
parent 9b28ef0a37
commit f93ec43915
10 changed files with 137 additions and 76 deletions

View File

@@ -1,7 +1,7 @@
<?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">
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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.meowrain</groupId>
@@ -15,11 +15,31 @@
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-cloud-gateway.version>4.3.2</spring-cloud-gateway.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<!-- Spring Cloud Gateway -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway-server-webflux</artifactId>
<version>4.3.2</version>
</dependency>
<!-- Nacos Discovery (parent 应已引入 alibaba 版本管理) -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-sentinel-gateway</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,11 @@
package cn.meowrain.aioj.backend.gateway;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class AIOJGatewayApplication {
public static void main(String[] args) {
SpringApplication.run(AIOJGatewayApplication.class, args);
}
}

View File

@@ -0,0 +1,30 @@
spring:
application:
name: aioj-gateway
config:
import: optional:nacos:application.yaml
cloud:
nacos:
discovery:
password: nacos
username: nacos
server-addr: 10.0.0.10:8848
config:
server-addr: 10.0.0.10:8848
enabled: false
gateway:
server:
webflux:
routes:
- id: user
uri: lb://aioj-backend-user-service
predicates:
- Path=/api/user/**
filters:
- StripPrefix=2
logging:
level:
root: info
server:
port: 8085