From 9bef5663ec56e2961fb943d4f351cec799780abb Mon Sep 17 00:00:00 2001 From: chenyonghong Date: Mon, 24 May 2021 21:18:49 +0800 Subject: [PATCH] fix -> sdk -> 扩展参数字段 --- fw-hermes-sdk/src/main/java/cn/fw/hermes/sdk/api/para/MsgParamCondition.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/fw-hermes-sdk/src/main/java/cn/fw/hermes/sdk/api/para/MsgParamCondition.java b/fw-hermes-sdk/src/main/java/cn/fw/hermes/sdk/api/para/MsgParamCondition.java index 61819d6..708194d 100644 --- a/fw-hermes-sdk/src/main/java/cn/fw/hermes/sdk/api/para/MsgParamCondition.java +++ b/fw-hermes-sdk/src/main/java/cn/fw/hermes/sdk/api/para/MsgParamCondition.java @@ -76,7 +76,7 @@ public class MsgParamCondition { private MsgParamCondition(MsgTypeEnum msgTypeEnum, TextContent textContent, LocationContent locationContent, FaceContent faceContent, CustomContent customContent, boolean unitMsg, List contentList, boolean useOfflineMsg, - OfflinePushInfo offlinePushInfo, Integer msgLifeTime, Long userId, BusinessType businessType) { + OfflinePushInfo offlinePushInfo, Integer msgLifeTime, Long userId, BusinessType businessType,boolean isStaff) { this.msgTypeEnum = msgTypeEnum; this.textContent = textContent; this.locationContent = locationContent; @@ -89,6 +89,7 @@ public class MsgParamCondition { this.msgLifeTime = msgLifeTime; this.userId = userId; this.businessType = businessType; + this.isStaff = isStaff; } /** @@ -209,9 +210,10 @@ public class MsgParamCondition { * @param lifeTime 离线保留时长(秒) 最长7天 * @param userId 目标 * @param useOffline 是否离线推送 + * @param isStaff 消息接收人是否为业务人员,必填 * @return */ - public static Builder getCustomMsg(String desc, String title, Map ext, Integer lifeTime, Long userId, boolean useOffline) { + public static Builder getCustomMsg(String desc, String title, Map ext, Integer lifeTime, Long userId, boolean useOffline,Boolean isStaff) { CustomContent customContent = new CustomContent(); title = title == null ? "" : title; customContent.setData(title); @@ -227,7 +229,8 @@ public class MsgParamCondition { .setMsgLifeTime(lifeTime) .setUserId(userId) .setUnitMsg(false) - .setUseOfflineMsg(useOffline); + .setUseOfflineMsg(useOffline) + .setIsStaff(isStaff); if (useOffline) { OfflinePushInfo o = new OfflinePushInfo(); o.setTitle(title); @@ -255,6 +258,7 @@ public class MsgParamCondition { private Integer msgLifeTime; private Long userId; private BusinessType businessType; + private Boolean isStaff; public Builder setMsgType(MsgTypeEnum msgType) { @@ -317,6 +321,10 @@ public class MsgParamCondition { return this; } + public Builder setIsStaff(Boolean isStaff) { + this.isStaff = isStaff; + return this; + } public MsgParamCondition build() { if (CollectionUtils.isEmpty(contentList)) { unitMsg = false; @@ -328,7 +336,7 @@ public class MsgParamCondition { throw new IllegalArgumentException("目标不存在"); } return new MsgParamCondition(msgTypeEnum, textContent, locationContent, faceContent, customContent, unitMsg, contentList, - useOfflineMsg, offlinePushInfo, msgLifeTime, userId, businessType); + useOfflineMsg, offlinePushInfo, msgLifeTime, userId, businessType,isStaff); } } } -- libgit2 0.22.2