From a5666bc94ce12f10f7ee3c12c258293a4b3c6d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=91=E5=B9=B4=E6=A2=A6=E4=B8=8E=E7=A0=96?= <2847127106@qq.com> Date: Wed, 31 Jul 2024 09:40:47 +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 | 46 +++++++++++++++++++ pom.xml | 34 ++++++++++++++ .../com/muyu/common/rabbit/RabbitConfig.java | 30 ++++++++++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + 4 files changed, 111 insertions(+) create mode 100644 .gitignore create mode 100644 pom.xml 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..09bdfea --- /dev/null +++ b/.gitignore @@ -0,0 +1,46 @@ +###################################################################### +# Build Tools + +.gradle +/build/ +!gradle/wrapper/gradle-wrapper.jar + +target/ +!.mvn/wrapper/maven-wrapper.jar + +###################################################################### +# IDE + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### JRebel ### +rebel.xml +### NetBeans ### +nbproject/private/ +build/* +nbbuild/ +dist/ +nbdist/ +.nb-gradle/ + +###################################################################### +# Others +*.log +*.xml.versionsBackup +*.swp + +!*/build/*.java +!*/build/*.html +!*/build/*.xml \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..b8c3c52 --- /dev/null +++ b/pom.xml @@ -0,0 +1,34 @@ + + + 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/common/rabbit/RabbitConfig.java b/src/main/java/com/muyu/common/rabbit/RabbitConfig.java new file mode 100644 index 0000000..97a1a43 --- /dev/null +++ b/src/main/java/com/muyu/common/rabbit/RabbitConfig.java @@ -0,0 +1,30 @@ +package com.muyu.common.rabbit; + +import jakarta.annotation.PostConstruct; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.amqp.core.AmqpAdmin; +import org.springframework.amqp.core.AmqpTemplate; +import org.springframework.context.annotation.Configuration; + +/** + * @Author:胡杨 + * @name:RabbitConfig + * @Date:2024/7/30 下午8:49 + * @Description: com.muyu.common.rabbi.config + */ + +@Slf4j +@Configuration +@AllArgsConstructor +public class RabbitConfig { + private final AmqpAdmin amqpAdmin; + + private final AmqpTemplate amqpTemplate; + + @PostConstruct + public void init() { + log.info("Rabbit模块 启动成功!"); + } + +} 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