# cloud-ext **Repository Path**: wind_xukk/cloud-ext ## Basic Information - **Project Name**: cloud-ext - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-03-09 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # cloud-ext #### 介绍 {飞鹤 MQ Websocket 推送} #### 软件架构 1.spring boot 2.rabbitmq 3.websocket #### 安装教程 1. 可以修改配置文件 application-dev.yml ``` spring: rabbitmq: host: xukangkang.51vip.biz listener: simple: retry: enabled: true max-attempts: 3 default-requeue-rejected: false acknowledge-mode: auto concurrency: 5 username: wind password: Wind@2015 port: 26291 publisher-confirm-type: correlated publisher-returns: true ``` 2. CloudMqApplication.java main 启动 #### 使用说明 1. http://localhost:8080/message 推送接口 | 名称 | 类型 | 必须| 说明 | | :-----| ----: | ----: | :---- | | data | Object | 否| 内容,类型为{}的json类型| | messageType | String | 是| 消息类型(notice-通知公告,gtasks-我的待办,report-报表,feedback-意见反馈) | | isDefault | Integer | 否|是否采用默认消息类型处理方式,默认`0`。 (0-是 1-否)| | pushType | Integer | 否|推送类型,默认`0`。 (0-websocket 1-其他)| | pushWay | String | 否|推送途径,默认`WEB`。 (WEB-PC端的websocket APP-APP端的websocket)| | respType | Integer | 否 |响应类型。 (0-single单点推 1-multi多人推 2-broadcast广播推 3-group组推送) | | userList | String | 否 |待推送的人员,可多人按`,`分隔,如果是广播推可以为空| | excludeList | String | 否 |排除的推送的人员,可多人按`,`分隔| | groupList | String | 否| 待推送待组| | excludeGroupList | String | 否| 待排除待组| ``` { "data":{ "ff":1 }, "messageType":"notice", "pushType":0, "respType":"0", "userList":"xukk" } ``` 2. http://localhost:8080/ws/chat1 > websockt 测试页面 3. 组推送 前端配置文件 ``` client.connect({ userCode: "WEB_"+userCode, //用户ID group: "|A|B|C|D|" // 用户拥有的组链 } ``` 4. 前端事件 /message/public 接受全局广播事件 /message 接受 个人事件 多人事件 或者 组事件 接收到的json ``` { content: {},//自定义内容 respType: 0,//传播类型 0 单 1 多 2 广 3 组 messageType: "notice" (notice-通知公告,gtasks-我的待办,report-报表,feedback-意见反馈) } ``` #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request