Phase 1 #17: Spring Cloud Alibaba 微服务框架搭建
- Maven 父工程 wm-parent (Spring Boot 3.3.5 + Cloud 2023.0.3 + Alibaba 2023.0.1) - 12个子模块: wm-common/gateway/base/iot/data-engine/bpm/production/revenue/patrol/bi/notify/job - wm-common: 统一响应 R<T> + 全局异常处理 + BusinessException - wm-gateway: Spring Cloud Gateway 路由配置(7个微服务路由) - 集成: Nacos(注册/配置) + PostgreSQL + Redis + Kafka + Sa-Token + MyBatis-Plus + Knife4j - docker-compose.yml: 一键启动10个中间件(PG+PostGIS/TDengine/Redis/Kafka/EMQX/Nacos/ES/Kibana/MinIO/GeoServer)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?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>com.water</groupId><artifactId>wm-parent</artifactId><version>1.0.0-SNAPSHOT</version></parent>
|
||||
<artifactId>wm-data-engine</artifactId>
|
||||
<dependencies>
|
||||
<dependency><groupId>com.water</groupId><artifactId>wm-common</artifactId></dependency>
|
||||
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency>
|
||||
<dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId></dependency>
|
||||
<dependency><groupId>org.springframework.kafka</groupId><artifactId>spring-kafka</artifactId></dependency>
|
||||
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId></dependency>
|
||||
<dependency><groupId>org.postgresql</groupId><artifactId>postgresql</artifactId></dependency>
|
||||
<dependency><groupId>net.postgis</groupId><artifactId>postgis-jdbc</artifactId></dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.water.data_engine;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class DataEngineApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(DataEngineApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
server:
|
||||
port: 8083
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: wm-data-engine
|
||||
datasource:
|
||||
url: jdbc:postgresql://${PG_HOST:127.0.0.1}:5432/water_management
|
||||
username: ${PG_USER:water}
|
||||
password: ${PG_PASS:water123}
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: ${NACOS_HOST:127.0.0.1}:8848
|
||||
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:/mapper/**/*.xml
|
||||
Reference in New Issue
Block a user