消息推送提醒暂时提交(未完成)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -531,9 +531,9 @@ CREATE TABLE [js_sys_msg_push]
|
||||
[push_return_msg_id] varchar(200),
|
||||
[push_return_content] text,
|
||||
[push_status] char(1),
|
||||
[push_date] date,
|
||||
[push_date] datetime,
|
||||
[read_status] char(1),
|
||||
[read_date] date,
|
||||
[read_date] datetime,
|
||||
PRIMARY KEY ([id])
|
||||
);
|
||||
|
||||
@@ -560,9 +560,9 @@ CREATE TABLE [js_sys_msg_pushed]
|
||||
[push_return_code] varchar(200),
|
||||
[push_return_msg_id] varchar(200),
|
||||
[push_status] char(1),
|
||||
[push_date] date,
|
||||
[push_date] datetime,
|
||||
[read_status] char(1),
|
||||
[read_date] date,
|
||||
[read_date] datetime,
|
||||
PRIMARY KEY ([id])
|
||||
);
|
||||
|
||||
|
||||
@@ -534,9 +534,9 @@ CREATE TABLE js_sys_msg_push
|
||||
push_return_msg_id varchar(200) COMMENT '推送返回消息编号',
|
||||
push_return_content text COMMENT '推送返回的内容信息',
|
||||
push_status char(1) COMMENT '推送状态(0未推送 1成功 2失败)',
|
||||
push_date date COMMENT '推送时间',
|
||||
push_date datetime COMMENT '推送时间',
|
||||
read_status char(1) COMMENT '读取状态(0未送达 1未读 2已读)',
|
||||
read_date date COMMENT '读取时间',
|
||||
read_date datetime COMMENT '读取时间',
|
||||
PRIMARY KEY (id)
|
||||
) COMMENT = '消息推送表';
|
||||
|
||||
@@ -563,9 +563,9 @@ CREATE TABLE js_sys_msg_pushed
|
||||
push_return_code varchar(200) COMMENT '推送返回结果码',
|
||||
push_return_msg_id varchar(200) COMMENT '推送返回消息编号',
|
||||
push_status char(1) COMMENT '推送状态(0未推送 1成功 2失败)',
|
||||
push_date date COMMENT '推送时间',
|
||||
push_date datetime COMMENT '推送时间',
|
||||
read_status char(1) COMMENT '读取状态(0未送达 1未读 2已读)',
|
||||
read_date date COMMENT '读取时间',
|
||||
read_date datetime COMMENT '读取时间',
|
||||
PRIMARY KEY (id)
|
||||
) COMMENT = '消息已推送表';
|
||||
|
||||
|
||||
@@ -531,9 +531,9 @@ CREATE TABLE js_sys_msg_push
|
||||
push_return_msg_id varchar2(200),
|
||||
push_return_content clob,
|
||||
push_status char(1),
|
||||
push_date date,
|
||||
push_date timestamp,
|
||||
read_status char(1),
|
||||
read_date date,
|
||||
read_date timestamp,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
@@ -560,9 +560,9 @@ CREATE TABLE js_sys_msg_pushed
|
||||
push_return_code varchar2(200),
|
||||
push_return_msg_id varchar2(200),
|
||||
push_status char(1),
|
||||
push_date date,
|
||||
push_date timestamp,
|
||||
read_status char(1),
|
||||
read_date date,
|
||||
read_date timestamp,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
@@ -531,9 +531,9 @@ CREATE TABLE js_sys_msg_push
|
||||
push_return_msg_id varchar(200),
|
||||
push_return_content text,
|
||||
push_status char(1),
|
||||
push_date date,
|
||||
push_date timestamp,
|
||||
read_status char(1),
|
||||
read_date date,
|
||||
read_date timestamp,
|
||||
PRIMARY KEY (id)
|
||||
) WITHOUT OIDS;
|
||||
|
||||
@@ -560,9 +560,9 @@ CREATE TABLE js_sys_msg_pushed
|
||||
push_return_code varchar(200),
|
||||
push_return_msg_id varchar(200),
|
||||
push_status char(1),
|
||||
push_date date,
|
||||
push_date timestamp,
|
||||
read_status char(1),
|
||||
read_date date,
|
||||
read_date timestamp,
|
||||
PRIMARY KEY (id)
|
||||
) WITHOUT OIDS;
|
||||
|
||||
|
||||
@@ -383,7 +383,8 @@ web:
|
||||
${adminPath}/sys/online/count,
|
||||
${adminPath}/**/treeData,
|
||||
${adminPath}/file/**,
|
||||
${adminPath}/tags/*
|
||||
${adminPath}/tags/*,
|
||||
${adminPath}/msg/**
|
||||
|
||||
# 前台自动切换到手机视图拦截器
|
||||
mobile:
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('989516261885186048', '0', '0,', '9030', '0000009030,', '0', '0', '消息推送', '消息推送', '1', '', '', 'icon-envelope-letter', '', '', '60', '0', 'default', 'core', '0', 'system', getdate(), 'system', getdate(), '');
|
||||
INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('989516673799393280', '989516261885186048', '0,989516261885186048,', '30', '0000009030,0000000030,', '1', '1', '消息推送/未完成消息', '未完成消息', '1', '/msg/msgPush/list', '', '', '', 'msg:msgPush', '60', '1', 'default', 'core', '0', 'system', getdate(), 'system', getdate(), '');
|
||||
INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('989516723044716544', '989516261885186048', '0,989516261885186048,', '60', '0000009030,0000000060,', '1', '1', '消息推送/已完成消息', '已完成消息', '1', '/msg/msgPush/list?pushed=true', '', '', '', 'msg:msgPush', '60', '1', 'default', 'core', '0', 'system', getdate(), 'system', getdate(), '');
|
||||
INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('989516785057501184', '989516261885186048', '0,989516261885186048,', '90', '0000009030,0000000090,', '1', '1', '消息推送/消息模板管理', '消息模板管理', '1', '/msg/msgTemplate/list', '', '', '', 'msg:msgTemplate', '60', '1', 'default', 'core', '0', 'system', getdate(), 'system', getdate(), '');
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('989516261885186048', '0', '0,', '9030', '0000009030,', '0', '0', '消息推送', '消息推送', '1', '', '', 'icon-envelope-letter', '', '', '60', '0', 'default', 'core', '0', 'system', now(), 'system', now(), '');
|
||||
INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('989516673799393280', '989516261885186048', '0,989516261885186048,', '30', '0000009030,0000000030,', '1', '1', '消息推送/未完成消息', '未完成消息', '1', '/msg/msgPush/list', '', '', '', 'msg:msgPush', '60', '1', 'default', 'core', '0', 'system', now(), 'system', now(), '');
|
||||
INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('989516723044716544', '989516261885186048', '0,989516261885186048,', '60', '0000009030,0000000060,', '1', '1', '消息推送/已完成消息', '已完成消息', '1', '/msg/msgPush/list?pushed=true', '', '', '', 'msg:msgPush', '60', '1', 'default', 'core', '0', 'system', now(), 'system', now(), '');
|
||||
INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('989516785057501184', '989516261885186048', '0,989516261885186048,', '90', '0000009030,0000000090,', '1', '1', '消息推送/消息模板管理', '消息模板管理', '1', '/msg/msgTemplate/list', '', '', '', 'msg:msgTemplate', '60', '1', 'default', 'core', '0', 'system', now(), 'system', now(), '');
|
||||
|
||||
ALTER TABLE `js_sys_msg_push`
|
||||
CHANGE `push_date` `push_date` DATETIME NULL COMMENT '推送时间',
|
||||
CHANGE `read_date` `read_date` DATETIME NULL COMMENT '读取时间';
|
||||
ALTER TABLE `js_sys_msg_pushed`
|
||||
CHANGE `push_date` `push_date` DATETIME NULL COMMENT '推送时间',
|
||||
CHANGE `read_date` `read_date` DATETIME NULL COMMENT '读取时间';
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('989516261885186048', '0', '0,', '9030', '0000009030,', '0', '0', '消息推送', '消息推送', '1', '', '', 'icon-envelope-letter', '', '', '60', '0', 'default', 'core', '0', 'system', sysdate, 'system', sysdate, '');
|
||||
INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('989516673799393280', '989516261885186048', '0,989516261885186048,', '30', '0000009030,0000000030,', '1', '1', '消息推送/未完成消息', '未完成消息', '1', '/msg/msgPush/list', '', '', '', 'msg:msgPush', '60', '1', 'default', 'core', '0', 'system', sysdate, 'system', sysdate, '');
|
||||
INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('989516723044716544', '989516261885186048', '0,989516261885186048,', '60', '0000009030,0000000060,', '1', '1', '消息推送/已完成消息', '已完成消息', '1', '/msg/msgPush/list?pushed=true', '', '', '', 'msg:msgPush', '60', '1', 'default', 'core', '0', 'system', sysdate, 'system', sysdate, '');
|
||||
INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('989516785057501184', '989516261885186048', '0,989516261885186048,', '90', '0000009030,0000000090,', '1', '1', '消息推送/消息模板管理', '消息模板管理', '1', '/msg/msgTemplate/list', '', '', '', 'msg:msgTemplate', '60', '1', 'default', 'core', '0', 'system', sysdate, 'system', sysdate, '');
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('989516261885186048', '0', '0,', '9030', '0000009030,', '0', '0', '消息推送', '消息推送', '1', '', '', 'icon-envelope-letter', '', '', '60', '0', 'default', 'core', '0', 'system', now(), 'system', now(), '');
|
||||
INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('989516673799393280', '989516261885186048', '0,989516261885186048,', '30', '0000009030,0000000030,', '1', '1', '消息推送/未完成消息', '未完成消息', '1', '/msg/msgPush/list', '', '', '', 'msg:msgPush', '60', '1', 'default', 'core', '0', 'system', now(), 'system', now(), '');
|
||||
INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('989516723044716544', '989516261885186048', '0,989516261885186048,', '60', '0000009030,0000000060,', '1', '1', '消息推送/已完成消息', '已完成消息', '1', '/msg/msgPush/list?pushed=true', '', '', '', 'msg:msgPush', '60', '1', 'default', 'core', '0', 'system', now(), 'system', now(), '');
|
||||
INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks)
|
||||
VALUES ('989516785057501184', '989516261885186048', '0,989516261885186048,', '90', '0000009030,0000000090,', '1', '1', '消息推送/消息模板管理', '消息模板管理', '1', '/msg/msgTemplate/list', '', '', '', 'msg:msgTemplate', '60', '1', 'default', 'core', '0', 'system', now(), 'system', now(), '');
|
||||
@@ -13,6 +13,7 @@
|
||||
新增=New
|
||||
增行=New line
|
||||
刷新=Refresh
|
||||
查看=View
|
||||
展开=Expand
|
||||
展开一级=Expand level 1
|
||||
折叠=Collapse
|
||||
|
||||
@@ -75,6 +75,16 @@
|
||||
在线=Online
|
||||
注销=Logout
|
||||
|
||||
# =========== 消息提醒 ===========
|
||||
|
||||
消息=Message
|
||||
你有=You have
|
||||
条消息=messages
|
||||
查看全部消息=See All Messages
|
||||
查看消息=See message
|
||||
系统消息=System message
|
||||
您有\ {0}\ 条新消息,由于消息太多,这里为您合并,请点击查看按钮看详情。=You have {0} new message, because there are too many messages, for you merge, click View see details.
|
||||
|
||||
# =========== 个人中心 ===========
|
||||
|
||||
修改密保=Security question
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<li><a href="javascript:" id="switchSkin" title="${text('切换主题')}" style="margin-top:-1px;"><i class="fa fa-dashboard"></i></a></li>
|
||||
<% include('/modules/sys/sysIndex/topMenuLang.html'){} %>
|
||||
<% include('/modules/sys/sysIndex/topMenuOnline.html'){} %>
|
||||
<% //include('/modules/sys/sysIndex/topMenuMsg.html'){} %>
|
||||
<% include('/modules/sys/sysIndex/topMenuMsg.html'){} %>
|
||||
<% //include('/modules/sys/sysIndex/topMenuNotify.html'){} %>
|
||||
<% //include('/modules/sys/sysIndex/topMenuTask.html'){} %>
|
||||
<% include('/modules/sys/sysIndex/topMenuUser.html'){} %>
|
||||
|
||||
@@ -1,76 +1,44 @@
|
||||
<li class="dropdown messages-menu">
|
||||
<a href="javascript:" class="dropdown-toggle" data-hover="dropdown">
|
||||
<i class="fa fa-envelope-o"></i>
|
||||
<span class="label label-success">4</span>
|
||||
<span class="label label-success" id="msgNum">0</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="header">You have 4 messages</li>
|
||||
<li class="header">${text('你有')} <span id="msgNum2">0</span> ${text('条消息')}</li>
|
||||
<li>
|
||||
<!-- inner menu: contains the actual data -->
|
||||
<ul class="menu">
|
||||
<li><!-- start message -->
|
||||
<a href="#">
|
||||
<div class="pull-left">
|
||||
<img src="${ctxStatic}/images/user1.jpg" class="img-circle" alt="User Image">
|
||||
</div>
|
||||
<h4>
|
||||
Support Team
|
||||
<small><i class="fa fa-clock-o"></i> 5 mins</small>
|
||||
</h4>
|
||||
<p>Why not buy a new awesome theme?</p>
|
||||
</a>
|
||||
</li>
|
||||
<!-- end message -->
|
||||
<li>
|
||||
<a href="#">
|
||||
<div class="pull-left">
|
||||
<img src="${ctxStatic}/images/user1.jpg" class="img-circle" alt="User Image">
|
||||
</div>
|
||||
<h4>
|
||||
JeeSite Team
|
||||
<small><i class="fa fa-clock-o"></i> 2 hours</small>
|
||||
</h4>
|
||||
<p>Why not buy a new awesome theme?</p>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<div class="pull-left">
|
||||
<img src="${ctxStatic}/images/user1.jpg" class="img-circle" alt="User Image">
|
||||
</div>
|
||||
<h4>
|
||||
Developers
|
||||
<small><i class="fa fa-clock-o"></i> Today</small>
|
||||
</h4>
|
||||
<p>Why not buy a new awesome theme?</p>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<div class="pull-left">
|
||||
<img src="${ctxStatic}/images/user1.jpg" class="img-circle" alt="User Image">
|
||||
</div>
|
||||
<h4>
|
||||
Sales Department
|
||||
<small><i class="fa fa-clock-o"></i> Yesterday</small>
|
||||
</h4>
|
||||
<p>Why not buy a new awesome theme?</p>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<div class="pull-left">
|
||||
<img src="${ctxStatic}/images/user1.jpg" class="img-circle" alt="User Image">
|
||||
</div>
|
||||
<h4>
|
||||
Reviewers
|
||||
<small><i class="fa fa-clock-o"></i> 2 days</small>
|
||||
</h4>
|
||||
<p>Why not buy a new awesome theme?</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="menu" id="msgList"
|
||||
data-mergeMsgLimit="${@Global.getConfig('sys.msg.mergeMsgLimit', '5')}"
|
||||
data-mergeMsgTitle="${text('系统消息')}"
|
||||
data-mergeMsgContent="${text('您有 {0\} 条新消息,由于消息太多,这里为您合并,请点击查看按钮看详情。')}"></ul>
|
||||
</li>
|
||||
<li class="footer"><a href="#">See All Messages</a></li>
|
||||
<li class="footer"><a href="javascript:" data-href="${ctx}/msg/list"
|
||||
data-title="${text('查看全部消息')}" class="addTabPage">${text('查看全部消息')}</a></li>
|
||||
</ul>
|
||||
<script src="${ctxStatic}/jquery-timeago/jquery.timeago.js"></script>
|
||||
<script src="${ctxStatic}/jquery-timeago/i18n/jquery.timeago.${lang()}.js"></script>
|
||||
<script src="${ctxStatic}/modules/msg/topMenuMsg.js"></script>
|
||||
<script type="text/template" id="msgListTpl">
|
||||
<li id="msg{{d.id}}"><a href="javascript:"
|
||||
data-href="${ctx}/msg/readMsg?id={{d.id}}"
|
||||
onclick="readMsg(this, '${text('查看消息')}', '{{d.id}}')" >
|
||||
<div class="pull-left"><i class="img-circle bg-aqua icon-bubble"></i></div>
|
||||
<h4>{{d.msgContentEntity.title}} <small><i class="fa fa-clock-o"></i>
|
||||
<abbr class="timeago" title="{{d.sendDate}}">{{d.sendDate}}</abbr></small></h4>
|
||||
<p>{{=d.msgContentEntity.content}}</p>
|
||||
</a></li>
|
||||
</script>
|
||||
<script type="text/template" id="msgTipTpl">
|
||||
<abbr class="timeago" title="{{d.sendDate}}">{{d.sendDate}}</abbr>
|
||||
{{d.sendUserName}} <br/> {{=d.msgContentEntity.content}}
|
||||
<div style="margin:8px 0 0;float:right;">
|
||||
{{# $.each(d.msgContentEntity.buttons, function(idx, item){ }}
|
||||
<button class="btn btn-default btn-sm" type="button"
|
||||
data-href="${ctxPath}{{d.item.href}}"
|
||||
onclick="readMsg(this, '${text('查看消息')}', '{{d.item.id}}');">{{d.item.name}}</button>
|
||||
{{# }); }}
|
||||
<button type="button" class="btn btn-default btn-sm"
|
||||
data-href="${ctx}/msg/readMsg?id={{d.id}}"
|
||||
onclick="readMsg(this, '${text('消息详情')}', '{{d.id}}')">${text('查看')}</button>
|
||||
</div>
|
||||
</script>
|
||||
</li>
|
||||
@@ -5,7 +5,7 @@
|
||||
</a>
|
||||
<script>
|
||||
function refreshOnlineCount(){
|
||||
$.get('${ctx}/sys/online/count?__notUpdateSession=true', function(data){
|
||||
$.get('${ctx}/sys/online/count?__notUpdateSession=true&__t='+new Date().getTime(), function(data){
|
||||
try{$('#onlineCount').html(Number(data))}catch(e){}
|
||||
})
|
||||
}
|
||||
|
||||
95
modules/core/src/test/java/com/jeesite/test/MsgPushTest.java
Normal file
95
modules/core/src/test/java/com/jeesite/test/MsgPushTest.java
Normal file
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.test;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.annotation.Rollback;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.lang.DateUtils;
|
||||
import com.jeesite.common.tests.BaseSpringContextTests;
|
||||
import com.jeesite.modules.msg.entity.content.AppMsgContent;
|
||||
import com.jeesite.modules.msg.entity.content.EmailMsgContent;
|
||||
import com.jeesite.modules.msg.entity.content.PcMsgContent;
|
||||
import com.jeesite.modules.msg.entity.content.SmsMsgContent;
|
||||
import com.jeesite.modules.msg.utils.MsgPushUtils;
|
||||
|
||||
/**
|
||||
* 消息推送测试类
|
||||
* @author ThinkGem
|
||||
* @version 2018-5-11
|
||||
*/
|
||||
@ActiveProfiles("test")
|
||||
@SpringBootTest(classes=ApplicationTest.class)
|
||||
@Rollback(false)
|
||||
public class MsgPushTest extends BaseSpringContextTests {
|
||||
|
||||
@Test
|
||||
public void testPC(){
|
||||
PcMsgContent msgContent = new PcMsgContent();
|
||||
msgContent.setTitle("提示信息");
|
||||
msgContent.setContent("您有1条新的任务");
|
||||
msgContent.addButton("办理", "/a/task/execute?id=123");
|
||||
// 即时推送消息
|
||||
MsgPushUtils.push(msgContent, "BizKey", "BizType", "system");
|
||||
// 定时推送消息
|
||||
MsgPushUtils.push(msgContent, "BizKey", "BizType", "system", DateUtils.parseDate("2018-05-05 08:30"), Global.YES);
|
||||
// 延迟推送消息
|
||||
MsgPushUtils.push(msgContent, "BizKey", "BizType", "system", new Date(), Global.YES);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApp(){
|
||||
AppMsgContent msgContent = new AppMsgContent();
|
||||
msgContent.setTitle("提示信息");
|
||||
msgContent.setContent("您有1条新的任务");
|
||||
// 即时推送消息
|
||||
MsgPushUtils.push(msgContent, "BizKey", "BizType", "system");
|
||||
// 定时推送消息
|
||||
MsgPushUtils.push(msgContent, "BizKey", "BizType", "system", DateUtils.parseDate("2018-05-05 08:30"), Global.YES);
|
||||
// 延迟推送消息
|
||||
MsgPushUtils.push(msgContent, "BizKey", "BizType", "system", new Date(), Global.YES);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSMS(){
|
||||
SmsMsgContent msgContent = new SmsMsgContent();
|
||||
msgContent.setTitle("提示信息");
|
||||
msgContent.setContent("您好,您的验证码是:123456(请勿透露给其他人)感谢您的使用。");
|
||||
// 即时推送消息
|
||||
MsgPushUtils.push(msgContent, "BizKey", "BizType", "system");
|
||||
// 定时推送消息
|
||||
MsgPushUtils.push(msgContent, "BizKey", "BizType", "system", DateUtils.parseDate("2018-05-05 08:30"), Global.YES);
|
||||
// 延迟推送消息
|
||||
MsgPushUtils.push(msgContent, "BizKey", "BizType", "system", new Date(), Global.YES);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMail(){
|
||||
EmailMsgContent msgContent = new EmailMsgContent();
|
||||
msgContent.setTitle("提示信息");
|
||||
msgContent.setContent("这是一条测试邮件内容");
|
||||
// 即时推送消息
|
||||
MsgPushUtils.push(msgContent, "BizKey", "BizType", "system");
|
||||
// 定时推送消息
|
||||
MsgPushUtils.push(msgContent, "BizKey", "BizType", "system", DateUtils.parseDate("2018-05-05 08:30"), Global.YES);
|
||||
// 延迟推送消息
|
||||
MsgPushUtils.push(msgContent, "BizKey", "BizType", "system", new Date(), Global.YES);
|
||||
}
|
||||
|
||||
// @Test
|
||||
// public void test(){
|
||||
// for (int i=0; i<5; i++){
|
||||
// testPC();
|
||||
// testApp();
|
||||
// testSMS();
|
||||
// testMail();
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -531,9 +531,9 @@ CREATE TABLE [js_sys_msg_push]
|
||||
[push_return_msg_id] varchar(200),
|
||||
[push_return_content] text,
|
||||
[push_status] char(1),
|
||||
[push_date] date,
|
||||
[push_date] datetime,
|
||||
[read_status] char(1),
|
||||
[read_date] date,
|
||||
[read_date] datetime,
|
||||
PRIMARY KEY ([id])
|
||||
);
|
||||
|
||||
@@ -560,9 +560,9 @@ CREATE TABLE [js_sys_msg_pushed]
|
||||
[push_return_code] varchar(200),
|
||||
[push_return_msg_id] varchar(200),
|
||||
[push_status] char(1),
|
||||
[push_date] date,
|
||||
[push_date] datetime,
|
||||
[read_status] char(1),
|
||||
[read_date] date,
|
||||
[read_date] datetime,
|
||||
PRIMARY KEY ([id])
|
||||
);
|
||||
|
||||
|
||||
@@ -534,9 +534,9 @@ CREATE TABLE js_sys_msg_push
|
||||
push_return_msg_id varchar(200) COMMENT '推送返回消息编号',
|
||||
push_return_content text COMMENT '推送返回的内容信息',
|
||||
push_status char(1) COMMENT '推送状态(0未推送 1成功 2失败)',
|
||||
push_date date COMMENT '推送时间',
|
||||
push_date datetime COMMENT '推送时间',
|
||||
read_status char(1) COMMENT '读取状态(0未送达 1未读 2已读)',
|
||||
read_date date COMMENT '读取时间',
|
||||
read_date datetime COMMENT '读取时间',
|
||||
PRIMARY KEY (id)
|
||||
) COMMENT = '消息推送表';
|
||||
|
||||
@@ -563,9 +563,9 @@ CREATE TABLE js_sys_msg_pushed
|
||||
push_return_code varchar(200) COMMENT '推送返回结果码',
|
||||
push_return_msg_id varchar(200) COMMENT '推送返回消息编号',
|
||||
push_status char(1) COMMENT '推送状态(0未推送 1成功 2失败)',
|
||||
push_date date COMMENT '推送时间',
|
||||
push_date datetime COMMENT '推送时间',
|
||||
read_status char(1) COMMENT '读取状态(0未送达 1未读 2已读)',
|
||||
read_date date COMMENT '读取时间',
|
||||
read_date datetime COMMENT '读取时间',
|
||||
PRIMARY KEY (id)
|
||||
) COMMENT = '消息已推送表';
|
||||
|
||||
|
||||
@@ -531,9 +531,9 @@ CREATE TABLE js_sys_msg_push
|
||||
push_return_msg_id varchar2(200),
|
||||
push_return_content clob,
|
||||
push_status char(1),
|
||||
push_date date,
|
||||
push_date timestamp,
|
||||
read_status char(1),
|
||||
read_date date,
|
||||
read_date timestamp,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
@@ -560,9 +560,9 @@ CREATE TABLE js_sys_msg_pushed
|
||||
push_return_code varchar2(200),
|
||||
push_return_msg_id varchar2(200),
|
||||
push_status char(1),
|
||||
push_date date,
|
||||
push_date timestamp,
|
||||
read_status char(1),
|
||||
read_date date,
|
||||
read_date timestamp,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
@@ -531,9 +531,9 @@ CREATE TABLE js_sys_msg_push
|
||||
push_return_msg_id varchar(200),
|
||||
push_return_content text,
|
||||
push_status char(1),
|
||||
push_date date,
|
||||
push_date timestamp,
|
||||
read_status char(1),
|
||||
read_date date,
|
||||
read_date timestamp,
|
||||
PRIMARY KEY (id)
|
||||
) WITHOUT OIDS;
|
||||
|
||||
@@ -560,9 +560,9 @@ CREATE TABLE js_sys_msg_pushed
|
||||
push_return_code varchar(200),
|
||||
push_return_msg_id varchar(200),
|
||||
push_status char(1),
|
||||
push_date date,
|
||||
push_date timestamp,
|
||||
read_status char(1),
|
||||
read_date date,
|
||||
read_date timestamp,
|
||||
PRIMARY KEY (id)
|
||||
) WITHOUT OIDS;
|
||||
|
||||
|
||||
@@ -348,7 +348,8 @@ jdbc:
|
||||
# ${adminPath}/sys/online/count,
|
||||
# ${adminPath}/**/treeData,
|
||||
# ${adminPath}/file/**,
|
||||
# ${adminPath}/tags/*
|
||||
# ${adminPath}/tags/*,
|
||||
# ${adminPath}/msg/**
|
||||
#
|
||||
# # 前台自动切换到手机视图拦截器
|
||||
# mobile:
|
||||
|
||||
Reference in New Issue
Block a user