From 5683f2d47dbfc07940b1f7b663c2ca1ea7dccb39 Mon Sep 17 00:00:00 2001 From: yangpeng <3074487626@qq.com> Date: Sun, 4 Aug 2024 10:58:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 36 ++++++++++++++++++ pom.xml | 38 +++++++++++++++++++ src/main/java/com/muyu/Main.java | 7 ++++ .../com/muyu/common/rabbit/RabbitConfig.java | 25 ++++++++++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + 5 files changed, 107 insertions(+) create mode 100644 .gitignore create mode 100644 pom.xml create mode 100644 src/main/java/com/muyu/Main.java create mode 100644 src/main/java/com/muyu/common/rabbit/RabbitConfig.java create mode 100644 src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c3f05f5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,36 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..bf76c33 --- /dev/null +++ b/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + + + com.muyu + cloud-common + 3.6.3 + + + + cloud-common-rabbit + 1.0.0 + + + + + 17 + 17 + UTF-8 + + + + + + com.muyu + cloud-common-core + + + org.springframework.boot + spring-boot-starter-amqp + + + + + diff --git a/src/main/java/com/muyu/Main.java b/src/main/java/com/muyu/Main.java new file mode 100644 index 0000000..95690d4 --- /dev/null +++ b/src/main/java/com/muyu/Main.java @@ -0,0 +1,7 @@ +package com.muyu; + +public class Main { + public static void main(String[] args) { + System.out.println("Hello world!"); + } +} \ No newline at end of file diff --git a/src/main/java/com/muyu/common/rabbit/RabbitConfig.java b/src/main/java/com/muyu/common/rabbit/RabbitConfig.java new file mode 100644 index 0000000..6fb6ebb --- /dev/null +++ b/src/main/java/com/muyu/common/rabbit/RabbitConfig.java @@ -0,0 +1,25 @@ +package com.muyu.common.rabbit; + +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.amqp.core.AmqpAdmin; +import org.springframework.amqp.core.AmqpTemplate; +import org.springframework.context.annotation.Configuration; + +import javax.annotation.PostConstruct; + +@Log4j2 +@Configuration +@AllArgsConstructor +public class RabbitConfig { + + private final AmqpAdmin AmqpAdmin; + + private final AmqpTemplate AmqpTemplate; + + @PostConstruct + private void init(){ + log.info("RabbitMq启动成功"); + } + +} diff --git a/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..6759042 --- /dev/null +++ b/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +com.muyu.common.rabbit.RabbitConfig