From 5f977e9e2d9b68b7fcf5b4c7e56626857784c4f8 Mon Sep 17 00:00:00 2001 From: heqijun Date: Wed, 4 Jun 2025 18:56:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9E=84=E5=BB=BAbeacon-api=E5=B7=A5=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- beacon-api/pom.xml | 52 +++++++++++++++++++ .../com/mashibing/api/ApiApplicaiton.java | 24 +++++++++ beacon-api/src/main/resources/bootstrap.yml | 17 ++++++ pom.xml | 5 +- 4 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 beacon-api/pom.xml create mode 100644 beacon-api/src/main/java/com/mashibing/api/ApiApplicaiton.java create mode 100644 beacon-api/src/main/resources/bootstrap.yml diff --git a/beacon-api/pom.xml b/beacon-api/pom.xml new file mode 100644 index 0000000..b362b89 --- /dev/null +++ b/beacon-api/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + com.mashibing + beacon-cloud + 1.0-SNAPSHOT + + + 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 + + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + + org.springframework.boot + spring-boot-starter-amqp + + + + org.projectlombok + lombok + + + + org.springframework.boot + spring-boot-starter-test + + + + \ No newline at end of file diff --git a/beacon-api/src/main/java/com/mashibing/api/ApiApplicaiton.java b/beacon-api/src/main/java/com/mashibing/api/ApiApplicaiton.java new file mode 100644 index 0000000..ddf5577 --- /dev/null +++ b/beacon-api/src/main/java/com/mashibing/api/ApiApplicaiton.java @@ -0,0 +1,24 @@ +package com.mashibing.api; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; + +/** + * @author heqijun + * @ClassName: ApiApplicaiton + * @Description: api服务启动类 + * @date 2025/6/4 18:48 + */ + + +@SpringBootApplication +@EnableFeignClients +@EnableDiscoveryClient +public class ApiApplicaiton { + + public static void main(String[] args) { + SpringApplication.run(ApiApplicaiton.class, args); + } +} diff --git a/beacon-api/src/main/resources/bootstrap.yml b/beacon-api/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..fd3e373 --- /dev/null +++ b/beacon-api/src/main/resources/bootstrap.yml @@ -0,0 +1,17 @@ +# 服务名称 +spring: + application: + name: beacon-api + # 多环境 + profiles: + active: dev + # nacos注册中心地址 + cloud: + nacos: + discovery: + server-addr: 192.168.1.13:8848 + # nacos配置中心地址: + config: + server-addr: 192.168.1.13:8848 + file-extension: yml + # beacon-api-dev.yml \ No newline at end of file diff --git a/pom.xml b/pom.xml index 4eefa3f..200fe5f 100644 --- a/pom.xml +++ b/pom.xml @@ -8,6 +8,9 @@ beacon-cloud 1.0-SNAPSHOT pom + + beacon-api + @@ -19,7 +22,7 @@ Hoxton.SR12 - 2.2.6.RELEASE + 2.2.7.RELEASE