Merge branch 'feature/REQ-1507' of axzsource.com:universal/infrastructure/backend/msg-center-plat into dev
This commit is contained in:
commit
81f217b233
@ -1,7 +1,6 @@
|
||||
package cn.axzo.msg.center.message.domain.dto;
|
||||
|
||||
import cn.axzo.msg.center.domain.entity.MessageBaseTemplate;
|
||||
import cn.axzo.msg.center.service.dto.BizDetailShowStrategyDTO;
|
||||
import cn.axzo.msg.center.service.dto.MessageCardContentItemDTO;
|
||||
import cn.axzo.msg.center.service.enums.MessageCategoryEnum;
|
||||
import cn.axzo.msg.center.service.enums.PushTerminalEnum;
|
||||
@ -65,10 +64,6 @@ public class MessageTemplateDTO implements Serializable {
|
||||
* 模板icon
|
||||
*/
|
||||
private String icon;
|
||||
/**
|
||||
* 业务详情展示策略
|
||||
*/
|
||||
private BizDetailShowStrategyDTO bizDetailShowStrategy;
|
||||
/**
|
||||
* 模板路由信息
|
||||
*/
|
||||
@ -84,8 +79,6 @@ public class MessageTemplateDTO implements Serializable {
|
||||
|
||||
public static MessageTemplateDTO from(MessageBaseTemplate baseTemplate, List<RawMessageRouterDTO> routers) {
|
||||
// 业务详情展示策略
|
||||
BizDetailShowStrategyDTO bizDetailShowStrategy = MessageRouterUtil.selectAndConvertBizDetailShowStrategy(
|
||||
baseTemplate.getBizDetailShowStrategy(), routers).orElse(null);
|
||||
return MessageTemplateDTO.builder()
|
||||
.name(baseTemplate.getName())
|
||||
.code(baseTemplate.getCode())
|
||||
@ -93,7 +86,6 @@ public class MessageTemplateDTO implements Serializable {
|
||||
.content(baseTemplate.getContent())
|
||||
.msgCardContentItems(JSONObjectUtil.parseArray(baseTemplate.getCardContent(), MessageCardContentItemDTO.class))
|
||||
.msgCategory(baseTemplate.getMsgCategory())
|
||||
.bizDetailShowStrategy(bizDetailShowStrategy)
|
||||
.icon(baseTemplate.getIcon())
|
||||
.routers(MessageRouterUtil.selectRouterButtons(routers))
|
||||
.pushTerminals(JSON.parseArray(baseTemplate.getPushTerminal(), PushTerminalEnum.class))
|
||||
|
||||
@ -0,0 +1,144 @@
|
||||
package cn.axzo.msg.center.message.domain.dto;
|
||||
|
||||
import cn.axzo.msg.center.service.enums.BizDetailShowStrategyEnum;
|
||||
import cn.axzo.msg.center.service.enums.MessageCategoryEnum;
|
||||
import cn.axzo.msg.center.service.enums.RouterButtonSourceEnum;
|
||||
import cn.axzo.msg.center.service.enums.TerminalTypeEnum;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author cold_blade
|
||||
* @date 2023/11/8
|
||||
* @version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MessageTemplateRouterDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4230859886203498149L;
|
||||
|
||||
/**
|
||||
* 业务详情路由
|
||||
*/
|
||||
private BizDetailRouterDTO bizDetailRouter;
|
||||
/**
|
||||
* 按钮路由列表
|
||||
*/
|
||||
private List<MessageTemplateRouteButtonDTO> routeButtons;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class BizDetailRouterDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6332526731908737802L;
|
||||
|
||||
/**
|
||||
* 模板编码
|
||||
*/
|
||||
private String templateCode;
|
||||
/**
|
||||
* 业务详情展示策略
|
||||
*/
|
||||
private BizDetailShowStrategyEnum bizDetailShowStrategy;
|
||||
/**
|
||||
* 跳转路由的配置列表
|
||||
*/
|
||||
private List<MessageRouterConfigDTO> routerConfigs;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MessageTemplateRouteButtonDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -7544674409859277745L;
|
||||
|
||||
/**
|
||||
* 按钮名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 按钮唯一标识
|
||||
*/
|
||||
private String btnCode;
|
||||
/**
|
||||
* 模板code
|
||||
*/
|
||||
private String templateCode;
|
||||
/**
|
||||
* 按钮来源
|
||||
*/
|
||||
private RouterButtonSourceEnum source;
|
||||
/**
|
||||
* 路由类型
|
||||
*/
|
||||
private MessageCategoryEnum category;
|
||||
/**
|
||||
* API地址,仅当按钮是接口调用类型时有值
|
||||
*/
|
||||
private String apiUrl;
|
||||
/**
|
||||
* 跳转路由的配置列表
|
||||
*/
|
||||
private List<MessageRouterConfigDTO> routerConfigs;
|
||||
/**
|
||||
* 按钮style配置
|
||||
*/
|
||||
private JSONObject style;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MessageRouterConfigDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -303015602477458085L;
|
||||
|
||||
/**
|
||||
* 路由编码
|
||||
*/
|
||||
private String routerCode;
|
||||
/**
|
||||
* 路由的系统类型
|
||||
*/
|
||||
private TerminalTypeEnum terminalType;
|
||||
/**
|
||||
* 路由地址
|
||||
*/
|
||||
private String url;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -14,7 +14,7 @@ import java.util.Map;
|
||||
* @date 2023/9/28
|
||||
* @version 1.0
|
||||
*/
|
||||
public interface MessageTemplateRouterService {
|
||||
public interface MessageTemplateRouterService {//TODO:[cold_blade] P0路由模型改版
|
||||
|
||||
/**
|
||||
* 根据消息模板编码查询配置的路由列表
|
||||
|
||||
@ -273,9 +273,6 @@ public class MessageTemplateNewServiceImpl implements MessageTemplateNewService
|
||||
template.setCardContent(JSONObjectUtil.toJSONString(param.getMsgCardContentItems()));
|
||||
template.setIcon(param.getIcon());
|
||||
template.setPushTerminal(JSONObjectUtil.toJSONString(param.getPushTerminals()));
|
||||
if (Objects.nonNull(param.getBizDetailShowStrategy())) {
|
||||
template.setBizDetailShowStrategy(param.getBizDetailShowStrategy().getShowStrategy());
|
||||
}
|
||||
template.setMinAppVersion(param.getMinAppVersion());
|
||||
template.setCreatorId(param.getOperatorId());
|
||||
template.setUpdaterId(param.getOperatorId());
|
||||
@ -314,8 +311,6 @@ public class MessageTemplateNewServiceImpl implements MessageTemplateNewService
|
||||
.set(StringUtils.isNotBlank(param.getIcon()), MessageBaseTemplate::getIcon, param.getIcon())
|
||||
.set(StringUtils.isNotBlank(param.getMinAppVersion()), MessageBaseTemplate::getMinAppVersion,
|
||||
param.getMinAppVersion())
|
||||
.set(Objects.nonNull(param.getBizDetailShowStrategy()), MessageBaseTemplate::getBizDetailShowStrategy,
|
||||
param.getBizDetailShowStrategy().getShowStrategy())
|
||||
.update();
|
||||
}
|
||||
|
||||
@ -413,9 +408,6 @@ public class MessageTemplateNewServiceImpl implements MessageTemplateNewService
|
||||
.collect(Collectors.toList());
|
||||
// 按钮路由策略
|
||||
List<MessageRouterButtonDTO> msgRouterButtons = MessageRouterUtil.selectAndConvertRouterButtons(routers);
|
||||
// 业务详情展示策略
|
||||
BizDetailShowStrategyDTO bizDetailShowStrategy = MessageRouterUtil.selectAndConvertBizDetailShowStrategy(
|
||||
record.getBizDetailShowStrategy(), routers).orElse(null);
|
||||
return MessageTemplateDetailResponse.builder()
|
||||
.templateName(record.getName())
|
||||
.category(MessageTemplateCategoryUtil.parentCategory(record.getMsgCategory()))
|
||||
@ -427,7 +419,8 @@ public class MessageTemplateNewServiceImpl implements MessageTemplateNewService
|
||||
.cardContentItems(JSONObjectUtil.parseArray(record.getCardContent(), MessageCardContentItemDTO.class))
|
||||
.msgIcon(record.getIcon())
|
||||
.routers(msgRouterButtons)
|
||||
.detailStrategy(bizDetailShowStrategy)
|
||||
// TODO: [cold_blade] P0
|
||||
.detailStrategy(null)
|
||||
.minAppVersion(record.getMinAppVersion())
|
||||
.createTimestamp(record.getCreateAt().getTime())
|
||||
.updateTimestamp(record.getUpdateAt().getTime())
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
package cn.axzo.msg.center.dal;
|
||||
|
||||
import cn.axzo.msg.center.dal.mapper.MessageRouteButtonMapper;
|
||||
import cn.axzo.msg.center.domain.entity.MessageRouteButton;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* @author cold_blade
|
||||
* @date 2023/11/8
|
||||
* @version 1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class MessageRouteButtonDao extends ServiceImpl<MessageRouteButtonMapper, MessageRouteButton> {
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package cn.axzo.msg.center.dal;
|
||||
|
||||
import cn.axzo.msg.center.dal.mapper.MessageRouteDetailMapper;
|
||||
import cn.axzo.msg.center.domain.entity.MessageRouteDetail;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* @author cold_blade
|
||||
* @date 2023/11/8
|
||||
* @version 1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class MessageRouteDetailDao extends ServiceImpl<MessageRouteDetailMapper, MessageRouteDetail> {
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package cn.axzo.msg.center.dal;
|
||||
|
||||
import cn.axzo.msg.center.dal.mapper.MessageRouterConfigMapper;
|
||||
import cn.axzo.msg.center.domain.entity.MessageRouterConfig;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* @author cold_blade
|
||||
* @date 2023/9/28
|
||||
* @version 1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class MessageRouterConfigDao extends ServiceImpl<MessageRouterConfigMapper, MessageRouterConfig> {
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package cn.axzo.msg.center.dal.mapper;
|
||||
|
||||
import cn.axzo.msg.center.domain.entity.GeneralMessageRecord;
|
||||
import cn.axzo.msg.center.domain.entity.MessageRouteButton;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* 消息路由按钮表Mapper
|
||||
* @author cold_blade
|
||||
* @date 2023/9/20
|
||||
* @version 1.0
|
||||
*/
|
||||
public interface MessageRouteButtonMapper extends BaseMapper<MessageRouteButton> {
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package cn.axzo.msg.center.dal.mapper;
|
||||
|
||||
import cn.axzo.msg.center.domain.entity.MessageRouteDetail;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* 消息路由业务详情表Mapper
|
||||
* @author cold_blade
|
||||
* @date 2023/9/20
|
||||
* @version 1.0
|
||||
*/
|
||||
public interface MessageRouteDetailMapper extends BaseMapper<MessageRouteDetail> {
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package cn.axzo.msg.center.dal.mapper;
|
||||
|
||||
import cn.axzo.msg.center.domain.entity.MessageRouterConfig;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* 消息路由配置表Mapper
|
||||
* @author cold_blade
|
||||
* @date 2023/9/20
|
||||
* @version 1.0
|
||||
*/
|
||||
public interface MessageRouterConfigMapper extends BaseMapper<MessageRouterConfig> {
|
||||
}
|
||||
@ -1,7 +1,6 @@
|
||||
package cn.axzo.msg.center.domain.entity;
|
||||
|
||||
import cn.axzo.msg.center.domain.persistence.BaseEntityExt;
|
||||
import cn.axzo.msg.center.service.enums.BizDetailShowStrategyEnum;
|
||||
import cn.axzo.msg.center.service.enums.MessageCategoryEnum;
|
||||
import cn.axzo.msg.center.service.enums.StatusEnum;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@ -67,10 +66,6 @@ public class MessageBaseTemplate extends BaseEntityExt<MessageBaseTemplate> impl
|
||||
* APP最小版本支持,可不配
|
||||
*/
|
||||
private String minAppVersion;
|
||||
/**
|
||||
* 业务详情展示策略
|
||||
*/
|
||||
private BizDetailShowStrategyEnum bizDetailShowStrategy;
|
||||
/**
|
||||
* 创建者自然人id
|
||||
*/
|
||||
|
||||
@ -0,0 +1,70 @@
|
||||
package cn.axzo.msg.center.domain.entity;
|
||||
|
||||
import cn.axzo.msg.center.domain.persistence.BaseEntityExt;
|
||||
import cn.axzo.msg.center.service.enums.MessageCategoryEnum;
|
||||
import cn.axzo.msg.center.service.enums.RouterButtonSourceEnum;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 消息路由按钮
|
||||
*
|
||||
* @author cold_blade
|
||||
* @date 2023/11/7
|
||||
* @version 1.0
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("message_route_button")
|
||||
public class MessageRouteButton extends BaseEntityExt<MessageRouteButton> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 2815163121368837804L;
|
||||
|
||||
/**
|
||||
* 按钮名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 按钮唯一标识
|
||||
*/
|
||||
private String btnCode;
|
||||
/**
|
||||
* 模板code
|
||||
*/
|
||||
private String templateCode;
|
||||
/**
|
||||
* 按钮来源
|
||||
*/
|
||||
private RouterButtonSourceEnum source;
|
||||
/**
|
||||
* 路由类型
|
||||
*/
|
||||
private MessageCategoryEnum category;
|
||||
/**
|
||||
* API地址,仅当按钮是接口调用类型时有值
|
||||
*/
|
||||
private String apiUrl;
|
||||
/**
|
||||
* 按钮style配置
|
||||
*/
|
||||
@TableField(typeHandler = FastjsonTypeHandler.class)
|
||||
private JSONObject style;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package cn.axzo.msg.center.domain.entity;
|
||||
|
||||
import cn.axzo.msg.center.domain.persistence.BaseEntityExt;
|
||||
import cn.axzo.msg.center.service.enums.BizDetailShowStrategyEnum;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 消息路由详情
|
||||
*
|
||||
* @author cold_blade
|
||||
* @date 2023/11/8
|
||||
* @version 1.0
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("message_route_detail")
|
||||
public class MessageRouteDetail extends BaseEntityExt<MessageRouteDetail> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6868015511438657632L;
|
||||
|
||||
/**
|
||||
* 显示名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 模板code
|
||||
*/
|
||||
private String templateCode;
|
||||
/**
|
||||
* 业务详情展示策略
|
||||
*/
|
||||
private BizDetailShowStrategyEnum showStrategy;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package cn.axzo.msg.center.domain.entity;
|
||||
|
||||
import cn.axzo.msg.center.domain.persistence.BaseEntityExt;
|
||||
import cn.axzo.msg.center.service.enums.TerminalTypeEnum;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 消息路由配置
|
||||
*
|
||||
* @author cold_blade
|
||||
* @date 2023/11/7
|
||||
* @version 1.0
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("message_router_config")
|
||||
public class MessageRouterConfig extends BaseEntityExt<MessageRouterConfig> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 2472826034240755399L;
|
||||
|
||||
/**
|
||||
* 路由编码
|
||||
*/
|
||||
private String routerCode;
|
||||
/**
|
||||
* 路由的系统类型
|
||||
*/
|
||||
private TerminalTypeEnum terminalType;
|
||||
/**
|
||||
* 路由地址
|
||||
*/
|
||||
private String url;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user