zheng-message初始化
This commit is contained in:
parent
88481dcce1
commit
50ad167e20
10
README.md
10
README.md
|
@ -68,10 +68,10 @@ zheng
|
|||
| ├── zheng-oss-sdk -- 开发工具包
|
||||
| ├── zheng-oss-web -- 前台接口[端口:7771]
|
||||
| └── zheng-oss-admin -- 后台管理[端口:7772]
|
||||
├── zheng-notify -- 实时推送系统
|
||||
| ├── zheng-notify-sdk -- 开发工具包
|
||||
| ├── zheng-notify-server -- 服务端[端口:8881,SocketIO端口:8882]
|
||||
| └── zheng-notify-client -- 客户端
|
||||
├── zheng-message -- 实时推送系统
|
||||
| ├── zheng-message-sdk -- 开发工具包
|
||||
| ├── zheng-message-server -- 服务端[端口:8881,SocketIO端口:8882]
|
||||
| └── zheng-message-client -- 客户端
|
||||
├── zheng-shop -- 电子商务系统
|
||||
└── zheng-demo -- 示例模块(包含一些示例代码等)
|
||||
├── zheng-demo-rpc-api -- rpc接口包
|
||||
|
@ -203,7 +203,7 @@ Spring+SpringMVC+Mybatis框架集成公共模块,包括公共配置、MybatisG
|
|||
|
||||
微信小程序后台
|
||||
|
||||
> zheng-notify
|
||||
> zheng-message
|
||||
|
||||
基于Netty实现SocketIO的实时推送系统。支持命名空间、二进制数据、SSL、ACK等功能。
|
||||
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -29,7 +29,7 @@
|
|||
<module>zheng-wechat</module>
|
||||
<module>zheng-shop</module>
|
||||
<module>zheng-api</module>
|
||||
<module>zheng-notify</module>
|
||||
<module>zheng-message</module>
|
||||
<module>zheng-demo</module>
|
||||
</modules>
|
||||
</project>
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.zheng</groupId>
|
||||
<artifactId>zheng-notify</artifactId>
|
||||
<artifactId>zheng-message</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>zheng-notify</name>
|
||||
<name>zheng-message</name>
|
||||
<url>http://www.zhangshuzheng.cn</url>
|
||||
|
||||
<properties>
|
||||
|
@ -19,7 +19,7 @@
|
|||
</properties>
|
||||
|
||||
<modules>
|
||||
<module>zheng-notify-sdk</module>
|
||||
<module>zheng-notify-server</module>
|
||||
<module>zheng-message-sdk</module>
|
||||
<module>zheng-message-server</module>
|
||||
</modules>
|
||||
</project>
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>管理监控中心</title>
|
||||
<title>实时推送系统前端示例</title>
|
||||
<style>
|
||||
#main{width:100%;height:400px;margin:0 auto;}
|
||||
.namespace{width:100%;height:400px;background:#000;}
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
<parent>
|
||||
<groupId>com.zheng</groupId>
|
||||
<artifactId>zheng-notify</artifactId>
|
||||
<artifactId>zheng-message</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>zheng-notify-sdk</artifactId>
|
||||
<artifactId>zheng-message-sdk</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>zheng-notify-sdk</name>
|
||||
<name>zheng-message-sdk</name>
|
||||
<url>http://www.zhangshuzheng.cn</url>
|
||||
|
||||
<properties>
|
||||
|
@ -32,7 +32,7 @@
|
|||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>zheng-notify-sdk</finalName>
|
||||
<finalName>zheng-message-sdk</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
|
@ -1,4 +1,4 @@
|
|||
package com.zheng.notify.sdk;
|
||||
package com.zheng.message.sdk;
|
||||
|
||||
/**
|
||||
* 统一返回结果类
|
|
@ -1,10 +1,10 @@
|
|||
package com.zheng.notify.sdk;
|
||||
package com.zheng.message.sdk;
|
||||
|
||||
/**
|
||||
* 全局常量
|
||||
* Created by shuzheng on 2018/6/28.
|
||||
*/
|
||||
public class NotifyConstants {
|
||||
public class MessageConstants {
|
||||
|
||||
// 通知类型:广播
|
||||
public static final String PUBLISH_TYPE_BROADCAST = "broadcast";
|
|
@ -1,4 +1,4 @@
|
|||
package com.zheng.notify.sdk;
|
||||
package com.zheng.message.sdk;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.http.HttpEntity;
|
||||
|
@ -16,7 +16,7 @@ import java.nio.charset.Charset;
|
|||
* 推送工具类
|
||||
* Created by shuzheng on 2018/6/28.
|
||||
*/
|
||||
public class NotifyHelper {
|
||||
public class MessageHelper {
|
||||
|
||||
/**
|
||||
* 推送消息
|
||||
|
@ -55,13 +55,13 @@ public class NotifyHelper {
|
|||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String url = "http://localhost:8881/notify/publish";
|
||||
String url = "http://localhost:8881/message/publish";
|
||||
PublishDto publishDto = new PublishDto();
|
||||
publishDto.setType(NotifyConstants.PUBLISH_TYPE_BROADCAST);
|
||||
publishDto.setType(MessageConstants.PUBLISH_TYPE_BROADCAST);
|
||||
publishDto.setNamespace("/demo");
|
||||
publishDto.setAccessKey("1");
|
||||
publishDto.setPayload("hi");
|
||||
BaseResult result = new NotifyHelper().publish(url, publishDto);
|
||||
BaseResult result = new MessageHelper().publish(url, publishDto);
|
||||
System.out.println(result.message);
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.zheng.notify.sdk;
|
||||
package com.zheng.message.sdk;
|
||||
|
||||
|
||||
/**
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
<parent>
|
||||
<groupId>com.zheng</groupId>
|
||||
<artifactId>zheng-notify</artifactId>
|
||||
<artifactId>zheng-message</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>zheng-notify-server</artifactId>
|
||||
<artifactId>zheng-message-server</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>zheng-notify-server</name>
|
||||
<name>zheng-message-server</name>
|
||||
<url>http://www.zhangshuzheng.cn</url>
|
||||
|
||||
<properties>
|
||||
|
@ -69,7 +69,7 @@
|
|||
</profiles>
|
||||
|
||||
<build>
|
||||
<finalName>zheng-notify-server</finalName>
|
||||
<finalName>zheng-message-server</finalName>
|
||||
<filters>
|
||||
<filter>src/main/resources/profiles/${env}.properties</filter>
|
||||
</filters>
|
|
@ -1,4 +1,4 @@
|
|||
package com.zheng.notify.server.controller;
|
||||
package com.zheng.message.server.controller;
|
||||
|
||||
import com.zheng.common.base.BaseController;
|
||||
import org.slf4j.Logger;
|
|
@ -10,7 +10,7 @@ log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n
|
|||
|
||||
### Log ###
|
||||
log4j.appender.log = org.apache.log4j.DailyRollingFileAppender
|
||||
log4j.appender.log.File = ../logs/zheng-notify-server.log
|
||||
log4j.appender.log.File = ../logs/zheng-message-server.log
|
||||
log4j.appender.log.Append = true
|
||||
log4j.appender.log.Threshold = DEBUG
|
||||
log4j.appender.log.DatePattern='.'yyyy-MM-dd
|
||||
|
@ -19,7 +19,7 @@ log4j.appender.log.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %p ] [
|
|||
|
||||
### Error ###
|
||||
log4j.appender.errorlog = org.apache.log4j.DailyRollingFileAppender
|
||||
log4j.appender.errorlog.File = ../logs/zheng-notify-server.error.log
|
||||
log4j.appender.errorlog.File = ../logs/zheng-message-server.error.log
|
||||
log4j.appender.errorlog.Append = true
|
||||
log4j.appender.errorlog.Threshold = ERROR
|
||||
log4j.appender.errorlog.DatePattern='.'yyyy-MM-dd
|
Loading…
Reference in New Issue