admin
2019-07-11 3824cbcaec6e6c67418d5280a53e9c2fedeef6f9
fanli/src/main/java/com/yeshi/fanli/util/push/PushUtils.java
@@ -9,12 +9,13 @@
import com.yeshi.fanli.entity.xinge.PushRecord;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.push.PushService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import net.sf.json.JSONObject;
public class PushUtils {
   @Resource
   private PushService pushService;
@@ -29,7 +30,9 @@
    */
   public static int allPushXiaoMi(MessageInfo info, JSONObject json, PushRecord pushRecord) throws Exception {
      if (Constant.IS_TEST)
         return 1;
      JSONObject mapXm = JSONObject.fromObject(json);
      String android = XiaoMiPushUtil.allPushAndroidForXM(info, mapXm);
@@ -63,6 +66,9 @@
       * Constant.systemCommonConfig.getIosBundleId());
       */
      if (Constant.IS_TEST)
         return 1;
      String IOS = IOSPushUtil.allPushIOS(deviceTokenList, info, url, type);
      LogHelper.userInfo("IOS的推送日志:" + IOS);
      pushRecord.setIosPushId(IOS);
@@ -82,6 +88,8 @@
    * @return
    */
   public static int singlePushXiaoMi(MessageInfo info, JSONObject json, PushRecord pushRecord) {
      if (Constant.IS_TEST)
         return 1;
      JSONObject mapXm = JSONObject.fromObject(json);
@@ -108,6 +116,8 @@
    */
   public static String singlePushIOS(MessageInfo info, PushRecord pushRecord, String url, int type,
         List<String> deviceTokenList) {
      if (Constant.IS_TEST)
         return null;
      if (deviceTokenList != null && deviceTokenList.size() > 0) {
         for (String deviceToken : deviceTokenList) {
            if (!StringUtil.isNullOrEmpty(deviceToken)) {