Przeglądaj źródła

getExpandNoticeSet

谭斌 2 lat temu
rodzic
commit
1f2229284a

+ 15 - 5
sys-sdk/src/main/java/com/xy/utils/SysCodeConfigureUtils.java

@@ -88,6 +88,16 @@ public class SysCodeConfigureUtils {
         return JSONUtil.parseObj(expand);
     }
 
+    /**
+     * 获取扩展通知设置
+     *
+     * @param expand 扩大
+     * @return {@link JSONObject}
+     */
+    public static JSONObject getExpandNoticeSet(String expand) {
+        return JSONUtil.parseObj(expand).getJSONObject("noticeSets");
+    }
+
     /**
      * 是否展示给商户
      *
@@ -95,7 +105,7 @@ public class SysCodeConfigureUtils {
      * @return {@link Boolean}
      */
     public static Boolean getExpShow2Merc(String expand) {
-        JSONObject exp = getExpand(expand);
+        JSONObject exp = getExpandNoticeSet(expand);
         return exp.getBool("show2merc");
     }
 
@@ -106,7 +116,7 @@ public class SysCodeConfigureUtils {
      * @return {@link Boolean}
      */
     public static Boolean getExpPush2Merc(String expand) {
-        JSONObject exp = getExpand(expand);
+        JSONObject exp = getExpandNoticeSet(expand);
         return exp.getBool("push2merc");
     }
 
@@ -117,7 +127,7 @@ public class SysCodeConfigureUtils {
      * @return {@link Boolean}
      */
     public static Boolean getExpCanUnSubscribe(String expand) {
-        JSONObject exp = getExpand(expand);
+        JSONObject exp = getExpandNoticeSet(expand);
         return exp.getBool("canUnsubscribe");
     }
 
@@ -128,7 +138,7 @@ public class SysCodeConfigureUtils {
      * @return {@link String}
      */
     public static String getMarker(String expand) {
-        JSONObject exp = getExpand(expand);
+        JSONObject exp = getExpandNoticeSet(expand);
         return exp.getStr("marker");
     }
 
@@ -139,7 +149,7 @@ public class SysCodeConfigureUtils {
      * @return {@link Boolean}
      */
     public static Boolean getExpCanPush(String expand) {
-        JSONObject exp = getExpand(expand);
+        JSONObject exp = getExpandNoticeSet(expand);
         //禁止推送时间段,只针对公众号消息,短信等 (为了免打扰!)
         String unPushTime = exp.getStr("unpushtime");
         if (StrUtil.isEmpty(unPushTime)) {