浏览代码

新增jpush场景配置字段

woody 10 月之前
父节点
当前提交
0c59957741

+ 5 - 0
framework-jpush/src/main/java/com/chelvc/framework/jpush/config/JPushProperties.java

@@ -54,6 +54,11 @@ public class JPushProperties {
      */
     @Data
     public static class Attribute {
+        /**
+         * 场景
+         */
+        private String scene;
+
         /**
          * 渠道
          */

+ 3 - 0
framework-jpush/src/main/java/com/chelvc/framework/jpush/context/JPushContextHolder.java

@@ -148,6 +148,9 @@ public final class JPushContextHolder {
      */
     public static JsonObject initializeAndroidChannel(@NonNull JPushProperties.Attribute attribute) {
         JsonObject channel = new JsonObject();
+        if (StringUtils.notEmpty(attribute.getScene())) {
+            channel.addProperty("category", attribute.getScene());
+        }
         if (StringUtils.notEmpty(attribute.getChannel())) {
             channel.addProperty("channel_id", attribute.getChannel());
         }