admin
2019-03-13 69bee82b81626b82b7f39f0e459e4f56b1699b51
fanli/src/main/java/com/yeshi/fanli/service/impl/push/XMPushServiceImpl.java
@@ -236,4 +236,38 @@
   }
   @Override
   public void pushWelfareCenter(Long uid, String title, String content) throws PushException {
      JSONObject json = new JSONObject();
      json.put("type", "welfare");
      json.put("miPushUrl", String.format("%s.ui.mine.WelfareCenterActivity",
            Constant.systemCommonConfig.getAndroidBaseactivityName()));
      // 1.5.1之后的版本可推送
      json.put("app_version", getVersionByMinVersionCode(36));
      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.WelfareCenterActivity",
            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);
      }
   }
}