Commit 13a5020e authored by shangtx's avatar shangtx

chore: 管理端websocket

parent afe3ec29
package com.onsiteservice.admin.listener;
import com.onsiteservice.common.socket.SocketHandler;
import com.onsiteservice.constant.constant.SysConstants;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.web.socket.TextMessage;
import javax.annotation.Resource;
/**
* 管理端事件通知
*/
@Component
@RabbitListener(queuesToDeclare = @Queue(SysConstants.Queue.ADMIN_ORDER))
public class OrderListener {
@Resource
private SocketHandler socketHandler;
@RabbitHandler
public void notice(Integer type) {
socketHandler.sendMessageToAll(new TextMessage("有新订单"));
}
}
......@@ -6,8 +6,8 @@ server:
project:
swagger:
enabled: true
title: 房屋线上修缮Web管理端${spring.profiles.active}环境
description: 房屋线上修缮Web管理端API文档
title: 城市匠人Web管理端${spring.profiles.active}环境
description: 城市匠人Web管理端API文档
base-package: com.onsiteservice.admin.controller,com.onsiteservice.common.business.controller
jwt:
enabled: true # 是否开启jwt拦截
......
......@@ -95,13 +95,6 @@
<version>4.3.0</version>
</dependency>
<!-- 极光推送服务端SDK -->
<dependency>
<groupId>cn.jpush.api</groupId>
<artifactId>jpush-client</artifactId>
<version>3.4.8</version>
</dependency>
<!-- Java 操作二维码生成与解析 -->
<dependency>
<groupId>com.google.zxing</groupId>
......@@ -141,23 +134,6 @@
<version>0.1.19</version>
</dependency>
<!-- 微信小程序 starter配合yaml配置需要在各自的模块中 -->
<!-- <dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java-miniapp-spring-boot-starter</artifactId>
</dependency>-->
<!--微信公众号-->
<!-- <dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java-mp-spring-boot-starter</artifactId>
</dependency>-->
<!--微信支付-->
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java-pay-spring-boot-starter</artifactId>
</dependency>
<!-- Spring Boot监控 -->
<dependency>
<groupId>org.springframework.boot</groupId>
......
......@@ -18,7 +18,8 @@ public class SysConstants {
* 消息队列定义
*/
public class Queue {
public static final String MESSAGE = "msg";
// 管理端订单
public static final String ADMIN_ORDER = "admin-order";
public static final String SMS = "sms";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment