commit 77b23199b70d9c467428b8bf5d458e4df78be4f8 Author: DongZeLiang <2746733890@qq.com> Date: Mon Jul 29 14:12:43 2024 +0800 初始化 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e403e3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +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..7a5798d --- /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..f606b7c --- /dev/null +++ b/src/main/java/com/muyu/common/rabbit/RabbitConfig.java @@ -0,0 +1,31 @@ +package com.muyu.common.rabbit; + +import jakarta.annotation.PostConstruct; +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; + +/** + * @Author: DongZeLiang + * @date: 2024/7/29 + * @Description: rabbitConfig + * @Version: 1.0 + */ +@Log4j2 +@Configuration +@AllArgsConstructor +public class RabbitConfig { + + private final AmqpAdmin amqpAdmin; + + private final AmqpTemplate amqpTemplate; + + @PostConstruct + public 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