Commit 9bef5663ec56e2961fb943d4f351cec799780abb
1 parent
ff0ede88
fix -> sdk -> 扩展参数字段
Showing
1 changed file
with
12 additions
and
4 deletions
fw-hermes-sdk/src/main/java/cn/fw/hermes/sdk/api/para/MsgParamCondition.java
... | ... | @@ -76,7 +76,7 @@ public class MsgParamCondition { |
76 | 76 | |
77 | 77 | private MsgParamCondition(MsgTypeEnum msgTypeEnum, TextContent textContent, LocationContent locationContent, FaceContent faceContent, |
78 | 78 | CustomContent customContent, boolean unitMsg, List<? extends BaseContent> contentList, boolean useOfflineMsg, |
79 | - OfflinePushInfo offlinePushInfo, Integer msgLifeTime, Long userId, BusinessType businessType) { | |
79 | + OfflinePushInfo offlinePushInfo, Integer msgLifeTime, Long userId, BusinessType businessType,boolean isStaff) { | |
80 | 80 | this.msgTypeEnum = msgTypeEnum; |
81 | 81 | this.textContent = textContent; |
82 | 82 | this.locationContent = locationContent; |
... | ... | @@ -89,6 +89,7 @@ public class MsgParamCondition { |
89 | 89 | this.msgLifeTime = msgLifeTime; |
90 | 90 | this.userId = userId; |
91 | 91 | this.businessType = businessType; |
92 | + this.isStaff = isStaff; | |
92 | 93 | } |
93 | 94 | |
94 | 95 | /** |
... | ... | @@ -209,9 +210,10 @@ public class MsgParamCondition { |
209 | 210 | * @param lifeTime 离线保留时长(秒) 最长7天 |
210 | 211 | * @param userId 目标 |
211 | 212 | * @param useOffline 是否离线推送 |
213 | + * @param isStaff 消息接收人是否为业务人员,必填 | |
212 | 214 | * @return |
213 | 215 | */ |
214 | - public static Builder getCustomMsg(String desc, String title, Map<String, Object> ext, Integer lifeTime, Long userId, boolean useOffline) { | |
216 | + public static Builder getCustomMsg(String desc, String title, Map<String, Object> ext, Integer lifeTime, Long userId, boolean useOffline,Boolean isStaff) { | |
215 | 217 | CustomContent customContent = new CustomContent(); |
216 | 218 | title = title == null ? "" : title; |
217 | 219 | customContent.setData(title); |
... | ... | @@ -227,7 +229,8 @@ public class MsgParamCondition { |
227 | 229 | .setMsgLifeTime(lifeTime) |
228 | 230 | .setUserId(userId) |
229 | 231 | .setUnitMsg(false) |
230 | - .setUseOfflineMsg(useOffline); | |
232 | + .setUseOfflineMsg(useOffline) | |
233 | + .setIsStaff(isStaff); | |
231 | 234 | if (useOffline) { |
232 | 235 | OfflinePushInfo o = new OfflinePushInfo(); |
233 | 236 | o.setTitle(title); |
... | ... | @@ -255,6 +258,7 @@ public class MsgParamCondition { |
255 | 258 | private Integer msgLifeTime; |
256 | 259 | private Long userId; |
257 | 260 | private BusinessType businessType; |
261 | + private Boolean isStaff; | |
258 | 262 | |
259 | 263 | |
260 | 264 | public Builder setMsgType(MsgTypeEnum msgType) { |
... | ... | @@ -317,6 +321,10 @@ public class MsgParamCondition { |
317 | 321 | return this; |
318 | 322 | } |
319 | 323 | |
324 | + public Builder setIsStaff(Boolean isStaff) { | |
325 | + this.isStaff = isStaff; | |
326 | + return this; | |
327 | + } | |
320 | 328 | public MsgParamCondition build() { |
321 | 329 | if (CollectionUtils.isEmpty(contentList)) { |
322 | 330 | unitMsg = false; |
... | ... | @@ -328,7 +336,7 @@ public class MsgParamCondition { |
328 | 336 | throw new IllegalArgumentException("目标不存在"); |
329 | 337 | } |
330 | 338 | return new MsgParamCondition(msgTypeEnum, textContent, locationContent, faceContent, customContent, unitMsg, contentList, |
331 | - useOfflineMsg, offlinePushInfo, msgLifeTime, userId, businessType); | |
339 | + useOfflineMsg, offlinePushInfo, msgLifeTime, userId, businessType,isStaff); | |
332 | 340 | } |
333 | 341 | } |
334 | 342 | } | ... | ... |