From 64fa40bb05e09c55617a581e006cd0d25c6fc986 Mon Sep 17 00:00:00 2001 From: yujian <yujian> Date: 星期五, 11 一月 2019 12:30:28 +0800 Subject: [PATCH] 网页推送、站内信推送时 PushRecord写入推送时间 --- fanli/src/main/java/com/yeshi/fanli/service/impl/push/XMPushServiceImpl.java | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 49 insertions(+), 1 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/push/XMPushServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/push/XMPushServiceImpl.java index 44390ed..9974017 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/push/XMPushServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/push/XMPushServiceImpl.java @@ -152,11 +152,59 @@ @Override public void pushWEEX(Long uid, String title, String content, String weexUrl) throws PushException { // TODO 鎺ㄩ�亀eex椤甸潰 + JSONObject json = new JSONObject(); + json.put("url", weexUrl); + json.put("type", "weex"); + MessageInfo info = new MessageInfo(); + info.setTitle(title); + info.setContent(content); + info.setDescription(content); + // 灏忕背鎺ㄩ�佺綉椤� + info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName()); + info.setActivty(String.format("%s.ui.mine.weex.WeexApplicationActivity", + Constant.systemCommonConfig.getAndroidBaseactivityName())); + + PushRecord pushRecord = new PushRecord(); + + // 灏忕背 鍏ㄦ帹 + if (uid == null || uid == 0) { + try { + PushUtils.allPushXiaoMi(info, json, pushRecord); + } catch (Exception e) { + PushLogHelper.xmError(e); + } + } else { + info.setAlias(uid + ""); + PushUtils.singlePushXiaoMi(info, json, pushRecord); + } } @Override public void pushBaiChuanUrl(Long uid, String title, String content, String url) throws PushException { - // TODO 鎺ㄩ�佺櫨宸濈殑閾炬帴 + JSONObject json = new JSONObject(); + json.put("url", url); + json.put("type", "baichuan"); + MessageInfo info = new MessageInfo(); + info.setTitle(title); + info.setContent(content); + info.setDescription(content); + // 灏忕背鎺ㄩ�佺綉椤� + info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName()); + + PushRecord pushRecord = new PushRecord(); + + // 灏忕背 鍏ㄦ帹 + if (uid == null || uid == 0) { + try { + PushUtils.allPushXiaoMi(info, json, pushRecord); + } catch (Exception e) { + PushLogHelper.xmError(e); + } + } else { + info.setAlias(uid + ""); + PushUtils.singlePushXiaoMi(info, json, pushRecord); + } + } } -- Gitblit v1.8.0