cloud 代码示例结构调整

This commit is contained in:
zhangdaiscott 2020-11-28 11:06:59 +08:00
parent 4686398cb2
commit 3ee0cef93b
12 changed files with 99 additions and 99 deletions

View File

@ -29,16 +29,16 @@
</exclusion>
</exclusions>
</dependency>
<!--rabbitmq消息队列-->
<dependency>
<groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-starter-rabbitmq</artifactId>
</dependency>
<!--xxl-job定时任务-->
<dependency>
<groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-starter-job</artifactId>
</dependency>
<!--rabbitmq消息队列
<dependency>
<groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-starter-rabbitmq</artifactId>
</dependency>-->
</dependencies>
<build>

View File

@ -1,11 +1,11 @@
package org.jeecg.modules.feigndemo.controller;
package org.jeecg.modules.cloud.feign.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.feigndemo.feign.JeecgTestClient;
import org.jeecg.modules.feigndemo.feign.JeecgTestClient2;
import org.jeecg.modules.cloud.feign.feign.JeecgTestClient;
import org.jeecg.modules.cloud.feign.feign.JeecgTestClient2;
import org.jeecg.starter.cloud.feign.impl.JeecgFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;

View File

@ -1,4 +1,4 @@
package org.jeecg.modules.feigndemo.feign;
package org.jeecg.modules.cloud.feign.feign;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.jeecg.modules.feigndemo.feign;
package org.jeecg.modules.cloud.feign.feign;
import org.jeecg.common.api.vo.Result;
import org.springframework.cloud.openfeign.FeignClient;

View File

@ -1,4 +1,4 @@
package org.jeecg.modules.feigndemo.feign;
package org.jeecg.modules.cloud.feign.feign;
import org.jeecg.common.api.vo.Result;
import org.springframework.web.bind.annotation.GetMapping;

View File

@ -0,0 +1,29 @@
//package org.jeecg.modules.cloud.rabbitmq;
//
//import com.rabbitmq.client.Channel;
//import org.jeecg.boot.starter.rabbitmq.core.BaseRabbiMqHandler;
//import org.jeecg.boot.starter.rabbitmq.listenter.MqListener;
//import org.jeecg.common.annotation.RabbitComponent;
//import org.jeecg.common.base.BaseMap;
//import org.springframework.amqp.rabbit.annotation.RabbitHandler;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.amqp.support.AmqpHeaders;
//import org.springframework.messaging.handler.annotation.Header;
//
//@RabbitListener(queues = "jeecg_place_order")
//@RabbitComponent(value = "helloReceiver1")
//public class HelloReceiver1 extends BaseRabbiMqHandler<BaseMap> {
//
// @RabbitHandler
// public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
// super.onMessage(baseMap, deliveryTag, channel, new MqListener<BaseMap>() {
// @Override
// public void handler(BaseMap map, Channel channel) {
// //业务处理
// String orderId = map.get("orderId").toString();
// System.out.println("Receiver1 : " + orderId);
// }
// });
// }
//
//}

View File

@ -0,0 +1,29 @@
//package org.jeecg.modules.cloud.rabbitmq;
//
//import com.rabbitmq.client.Channel;
//import org.jeecg.boot.starter.rabbitmq.core.BaseRabbiMqHandler;
//import org.jeecg.boot.starter.rabbitmq.listenter.MqListener;
//import org.jeecg.common.annotation.RabbitComponent;
//import org.jeecg.common.base.BaseMap;
//import org.springframework.amqp.rabbit.annotation.RabbitHandler;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.amqp.support.AmqpHeaders;
//import org.springframework.messaging.handler.annotation.Header;
//
//@RabbitListener(queues = "jeecg_place_order")
//@RabbitComponent(value = "helloReceiver2")
//public class HelloReceiver2 extends BaseRabbiMqHandler<BaseMap> {
//
// @RabbitHandler
// public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
// super.onMessage(baseMap, deliveryTag, channel, new MqListener<BaseMap>() {
// @Override
// public void handler(BaseMap map, Channel channel) {
// //业务处理
// String orderId = map.get("orderId").toString();
// System.out.println("Receiver2 : " + orderId);
// }
// });
// }
//
//}

View File

@ -0,0 +1,29 @@
//package org.jeecg.modules.cloud.rabbitmq;
//
//import com.rabbitmq.client.Channel;
//import org.jeecg.boot.starter.rabbitmq.core.BaseRabbiMqHandler;
//import org.jeecg.boot.starter.rabbitmq.listenter.MqListener;
//import org.jeecg.common.annotation.RabbitComponent;
//import org.jeecg.common.base.BaseMap;
//import org.springframework.amqp.rabbit.annotation.RabbitHandler;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.amqp.support.AmqpHeaders;
//import org.springframework.messaging.handler.annotation.Header;
//
//@RabbitListener(queues = "jeecg_place_order_time")
//@RabbitComponent(value = "helloTimeReceiver")
//public class HelloTimeReceiver extends BaseRabbiMqHandler<BaseMap> {
//
// @RabbitHandler
// public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
// super.onMessage(baseMap, deliveryTag, channel, new MqListener<BaseMap>() {
// @Override
// public void handler(BaseMap map, Channel channel) {
// //业务处理
// String orderId = map.get("orderId").toString();
// System.out.println("Receiver1 : " + orderId);
// }
// });
// }
//
//}

View File

@ -1,29 +0,0 @@
package org.jeecg.modules.cloud.test;
import com.rabbitmq.client.Channel;
import org.jeecg.boot.starter.rabbitmq.core.BaseRabbiMqHandler;
import org.jeecg.boot.starter.rabbitmq.listenter.MqListener;
import org.jeecg.common.annotation.RabbitComponent;
import org.jeecg.common.base.BaseMap;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.support.AmqpHeaders;
import org.springframework.messaging.handler.annotation.Header;
@RabbitListener(queues = "jeecg_place_order")
@RabbitComponent(value = "helloReceiver1")
public class HelloReceiver1 extends BaseRabbiMqHandler<BaseMap> {
@RabbitHandler
public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
super.onMessage(baseMap, deliveryTag, channel, new MqListener<BaseMap>() {
@Override
public void handler(BaseMap map, Channel channel) {
//业务处理
String orderId = map.get("orderId").toString();
System.out.println("Receiver1 : " + orderId);
}
});
}
}

View File

@ -1,29 +0,0 @@
package org.jeecg.modules.cloud.test;
import com.rabbitmq.client.Channel;
import org.jeecg.boot.starter.rabbitmq.core.BaseRabbiMqHandler;
import org.jeecg.boot.starter.rabbitmq.listenter.MqListener;
import org.jeecg.common.annotation.RabbitComponent;
import org.jeecg.common.base.BaseMap;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.support.AmqpHeaders;
import org.springframework.messaging.handler.annotation.Header;
@RabbitListener(queues = "jeecg_place_order")
@RabbitComponent(value = "helloReceiver2")
public class HelloReceiver2 extends BaseRabbiMqHandler<BaseMap> {
@RabbitHandler
public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
super.onMessage(baseMap, deliveryTag, channel, new MqListener<BaseMap>() {
@Override
public void handler(BaseMap map, Channel channel) {
//业务处理
String orderId = map.get("orderId").toString();
System.out.println("Receiver2 : " + orderId);
}
});
}
}

View File

@ -1,29 +0,0 @@
package org.jeecg.modules.cloud.test;
import com.rabbitmq.client.Channel;
import org.jeecg.boot.starter.rabbitmq.core.BaseRabbiMqHandler;
import org.jeecg.boot.starter.rabbitmq.listenter.MqListener;
import org.jeecg.common.annotation.RabbitComponent;
import org.jeecg.common.base.BaseMap;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.support.AmqpHeaders;
import org.springframework.messaging.handler.annotation.Header;
@RabbitListener(queues = "jeecg_place_order_time")
@RabbitComponent(value = "helloTimeReceiver")
public class HelloTimeReceiver extends BaseRabbiMqHandler<BaseMap> {
@RabbitHandler
public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
super.onMessage(baseMap, deliveryTag, channel, new MqListener<BaseMap>() {
@Override
public void handler(BaseMap map, Channel channel) {
//业务处理
String orderId = map.get("orderId").toString();
System.out.println("Receiver1 : " + orderId);
}
});
}
}