From f4a0f2acc63d7785eab108419a4e16f5f688cb95 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期六, 18 一月 2020 12:06:27 +0800 Subject: [PATCH] 用户注册信息 --- fanli/src/main/java/com/yeshi/fanli/util/push/IOSPushUtil.java | 39 +++++++++++++++++++++++---------------- 1 files changed, 23 insertions(+), 16 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/push/IOSPushUtil.java b/fanli/src/main/java/com/yeshi/fanli/util/push/IOSPushUtil.java index 507261a..af963df 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/push/IOSPushUtil.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/push/IOSPushUtil.java @@ -12,6 +12,7 @@ import com.google.gson.Gson; import com.yeshi.fanli.controller.admin.PushController; +import com.yeshi.fanli.dto.push.PushTypeEnum; import com.yeshi.fanli.entity.xinge.MessageInfo; import com.yeshi.fanli.entity.xinge.PushRecord; import com.yeshi.fanli.log.LogHelper; @@ -57,8 +58,8 @@ public static String allPushIOS(List<String> deviceTokenList, MessageInfo info, String url, int type) throws Exception { - if (Constant.IS_TEST) - return null; + // if (Constant.IS_TEST) + // return null; Gson gson = new Gson(); PushLogHelper.iosInfo("IOS鎺ㄩ�佽澶囨暟涓�:" + deviceTokenList.size()); @@ -70,7 +71,7 @@ // json鑷畾涔変紶鍊� JSONObject json = null; - if (type == PushController.GOODS) { + if (type == PushTypeEnum.goodsdetail.getCode()) { Long auctionId = null; if (url.contains("id=")) { String[] sts = url.split("\\?")[1].split("&"); @@ -83,26 +84,30 @@ if (auctionId == null) throw new Exception("娣樺疂鍟嗗搧ID鎻愬彇鍑洪敊"); json = IOSPushFactory.createGoodsPush(auctionId, info.getTitle(), info.getContent()); - } else if (type == PushController.URL) { + } else if (type == PushTypeEnum.url.getCode()) { String shortUrl = HttpUtil.getShortLink(url); if (StringUtil.isNullOrEmpty(shortUrl)) throw new Exception("鑾峰彇鐭摼鍑洪敊"); json = IOSPushFactory.createURLPush(shortUrl, info.getTitle(), info.getContent()); - } else if (type == PushController.ZNX) { + } else if (type == PushTypeEnum.ZNX.getCode()) { json = IOSPushFactory.createZNXPush(info.getTitle(), info.getContent()); - } else if (type == PushController.WEEX) { + } else if (type == PushTypeEnum.weex.getCode()) { String shortUrl = HttpUtil.getShortLink(url); if (StringUtil.isNullOrEmpty(shortUrl)) throw new Exception("鑾峰彇鐭摼鍑洪敊"); json = IOSPushFactory.createWEEXPush(shortUrl, info.getTitle(), info.getContent()); - } else if (type == PushController.BAICHUAN) { - String shortUrl = HttpUtil.getShortLink(url); - if (StringUtil.isNullOrEmpty(shortUrl)) - throw new Exception("鑾峰彇鐭摼鍑洪敊"); + } else if (type == PushTypeEnum.baichuan.getCode()) { + String shortUrl = url; + // HttpUtil.getShortLink(url); + // if (StringUtil.isNullOrEmpty(shortUrl)) + // throw new Exception("鑾峰彇鐭摼鍑洪敊"); json = IOSPushFactory.createBaiChuanPush(shortUrl, info.getTitle(), info.getContent()); - } else if (type == PushController.WELFARE_CENTER) { + } else if (type == PushTypeEnum.welfare.getCode()) { json = IOSPushFactory.createWelfarePush(info.getTitle(), info.getContent()); + } else if (type == PushTypeEnum.signin.getCode()) { + json = IOSPushFactory.createUserSignInPush(info.getTitle(), info.getContent()); } + // 鍒嗙粍鎺ㄩ�� 姣�50涓澶囦负涓�缁� InputStream certificate = IOSPushUtil.class.getClassLoader() @@ -241,7 +246,7 @@ // json鑷畾涔変紶鍊� JSONObject json = null; - if (type == PushController.GOODS) { + if (type == PushTypeEnum.goodsdetail.getCode()) { Long auctionId = null; if (url.contains("id=")) { String[] sts = url.split("\\?")[1].split("&"); @@ -254,23 +259,25 @@ if (auctionId == null) throw new Exception("娣樺疂鍟嗗搧ID鎻愬彇鍑洪敊"); json = IOSPushFactory.createGoodsPush(auctionId, info.getTitle(), info.getContent()); - } else if (type == PushController.URL) { + } else if (type == PushTypeEnum.url.getCode()) { String shortUrl = HttpUtil.getShortLink(url); if (StringUtil.isNullOrEmpty(shortUrl)) throw new Exception("鑾峰彇鐭摼鍑洪敊"); json = IOSPushFactory.createURLPush(shortUrl, info.getTitle(), info.getContent()); - } else if (type == PushController.ZNX) { + } else if (type == PushTypeEnum.ZNX.getCode()) { json = IOSPushFactory.createZNXPush(info.getTitle(), info.getContent()); - } else if (type == PushController.WEEX) { + } else if (type == PushTypeEnum.weex.getCode()) { String shortUrl = HttpUtil.getShortLink(url); if (StringUtil.isNullOrEmpty(shortUrl)) shortUrl = url; json = IOSPushFactory.createWEEXPush(shortUrl, info.getTitle(), info.getContent()); - } else if (type == PushController.BAICHUAN) { + } else if (type == PushTypeEnum.baichuan.getCode()) { String shortUrl = HttpUtil.getShortLink(url); if (StringUtil.isNullOrEmpty(shortUrl)) shortUrl = url; json = IOSPushFactory.createBaiChuanPush(shortUrl, info.getTitle(), info.getContent()); + } else if (type == PushTypeEnum.signin.getCode()) { + json = IOSPushFactory.createUserSignInPush(info.getTitle(), info.getContent()); } return json; -- Gitblit v1.8.0