admin
2018-12-25 4cb15e222cd7d099d533ccbeb7f9a8cd99bf180c
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 推送weex页面
      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);
      }
   }
}