commit b1aa9d5d7d58072895f280c2d5d8a0b44ed310e4 Author: msb_12211 Date: Thu Oct 19 10:44:40 2023 +0800 第一次提交 diff --git a/beacon-api/pom.xml b/beacon-api/pom.xml new file mode 100644 index 0000000..700476f --- /dev/null +++ b/beacon-api/pom.xml @@ -0,0 +1,27 @@ + + + + beacon-cloud + com.mashibing + 1.0-SNAPSHOT + + 4.0.0 + + beacon-api + + + org.springframework.boot + spring-boot-starter-web + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + \ No newline at end of file diff --git a/beacon-api/src/main/java/com/mashibing/api/ApiStarterApp.java b/beacon-api/src/main/java/com/mashibing/api/ApiStarterApp.java new file mode 100644 index 0000000..f16b620 --- /dev/null +++ b/beacon-api/src/main/java/com/mashibing/api/ApiStarterApp.java @@ -0,0 +1,13 @@ +package com.mashibing.api; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + +@SpringBootApplication +@EnableDiscoveryClient +public class ApiStarterApp { + public static void main(String[] args) { + SpringApplication.run(ApiStarterApp.class, args); + } +} diff --git a/beacon-api/src/main/java/com/mashibing/api/TestController.java b/beacon-api/src/main/java/com/mashibing/api/TestController.java new file mode 100644 index 0000000..dce8471 --- /dev/null +++ b/beacon-api/src/main/java/com/mashibing/api/TestController.java @@ -0,0 +1,12 @@ +package com.mashibing.api; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class TestController { + @RequestMapping("/test") + public String test(){ + return "success"; + } +} diff --git a/beacon-api/src/main/resources/bootstrap.yml b/beacon-api/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..97f515c --- /dev/null +++ b/beacon-api/src/main/resources/bootstrap.yml @@ -0,0 +1,19 @@ +#服务名称 +spring: + application: + name: beacon-api +#多环境 + profiles: + active: dev +#nacos注册中心地址 + cloud: + nacos: + discovery: + server-addr: 192.168.2.130:8848 + #nacos配置中心地址: + config: + server-addr: 192.168.2.130:8848 + file-extension: yml + # beacon-api-dev.yml + +