init
This commit is contained in:
50
oms-gateway/pom.xml
Normal file
50
oms-gateway/pom.xml
Normal file
@@ -0,0 +1,50 @@
|
||||
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.nl</groupId>
|
||||
<artifactId>omsCloud</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<groupId>org.nl</groupId>
|
||||
<artifactId>oms-gateway</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>gateway</name>
|
||||
<description>gateway</description>
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- OpenFeign(必须,用于调用远程服务) -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
<!-- Nacos 服务发现 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.nl</groupId>
|
||||
<artifactId>finnace-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.nl.gateway;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableFeignClients(basePackages = {"org.nl.finnaceapi.feignApi"}) // 扫描 Feign 接口
|
||||
public class GatewayApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(GatewayApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
22
oms-gateway/src/main/java/org/nl/gateway/InitController.java
Normal file
22
oms-gateway/src/main/java/org/nl/gateway/InitController.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package org.nl.gateway;
|
||||
|
||||
import org.nl.finnaceapi.dto.Init;
|
||||
import org.nl.finnaceapi.feignApi.FinanceFeignApi;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController()
|
||||
@RequestMapping("/api")
|
||||
public class InitController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private FinanceFeignApi financeFeignApi;
|
||||
|
||||
@GetMapping("/gateway")
|
||||
public Init getPlan(){
|
||||
return financeFeignApi.init();
|
||||
}
|
||||
}
|
||||
10
oms-gateway/src/main/resources/application.yml
Normal file
10
oms-gateway/src/main/resources/application.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
server:
|
||||
port: 8012
|
||||
spring:
|
||||
application:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: localhost:8848
|
||||
namespace: public
|
||||
enabled: true
|
||||
@@ -0,0 +1,13 @@
|
||||
package org.nl.gateway;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class GatewayApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user