Merge branch 'feature/REQ-1898' into 'pre'

Feature/req 1898

See merge request universal/infrastructure/backend/msg-center-plat!272
This commit is contained in:
杨林 2024-01-15 07:41:48 +00:00
commit 66946aed84

View File

@ -2,9 +2,9 @@ package cn.axzo.msg.center.api.request.v3;
import cn.axzo.basics.common.util.AssertUtil;
import cn.axzo.msg.center.service.dto.PersonV3DTO;
import cn.axzo.msg.center.service.enums.BizCategoryEnum;
import cn.axzo.msg.center.service.enums.IdentityTypeEnum;
import cn.axzo.msg.center.service.enums.OrganizationTypeEnum;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.Getter;
import lombok.Setter;
@ -16,6 +16,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static java.util.stream.Collectors.toSet;
@ -94,6 +95,30 @@ public class MessageSendReqV3 implements Serializable {
*/
private String receiversOrgName;
/**
* 渠道参数
*/
private Map<String, Object> channelParams;
public void addChannelParam(String key, Object object) {
if (channelParams == null) {
channelParams = new HashMap<>();
}
channelParams.put(key, object);
}
public <T> T readChannelParam(String key, Class<T> asType) {
if (channelParams == null) {
return null;
}
Object value = channelParams.get(key);
if (value == null) {
return null;
}
String json = JSON.toJSONString(value);
return JSON.parseObject(json, asType);
}
public Collection<PersonV3DTO> distinctReceivers() {
if (receivers == null) {
return Collections.emptySet();