feat:(REQ-3201) 模版管理V3-最低版本/消息通道/卡片样式/配置状态属性添加
This commit is contained in:
parent
6f0d8e63c1
commit
68386bd46e
@ -7,6 +7,7 @@ import cn.axzo.msg.center.message.service.MessageTemplateNewService;
|
||||
import cn.axzo.msg.center.message.service.MessageTemplateV3Service;
|
||||
import cn.axzo.msg.center.message.service.RelationTemplateMapService;
|
||||
import cn.axzo.msg.center.message.service.impl.MessageTemplateV3SyncService;
|
||||
import cn.axzo.msg.center.service.enums.CardState;
|
||||
import cn.axzo.msg.center.service.template.client.MessageTemplateV3Client;
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateSyncQueryRequest;
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateV3CreateRequest;
|
||||
@ -17,14 +18,17 @@ import cn.axzo.msg.center.service.template.request.MessageTemplateV3SyncResponse
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateV3UpdateRequest;
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateV3UpdateStatusRequest;
|
||||
import cn.axzo.msg.center.service.template.response.MessageDetailStyle;
|
||||
import cn.axzo.msg.center.service.template.response.MessageTemplateV3ConfigStateResponse;
|
||||
import cn.axzo.msg.center.service.template.response.MessageTemplateV3DetailResponse;
|
||||
import cn.axzo.msg.center.service.template.response.MessageTemplateV3PageResponse;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import cn.azxo.framework.common.model.Page;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@ -33,6 +37,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 消息模板管理
|
||||
@ -121,4 +126,13 @@ public class MessageTemplateV3Controller implements MessageTemplateV3Client {
|
||||
relationTemplateMapService.init(param);
|
||||
return CommonResponse.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置状态戳
|
||||
*/
|
||||
@Override
|
||||
public CommonResponse<List<MessageTemplateV3ConfigStateResponse>> configState() {
|
||||
List<CardState> cardStates = CardState.imageConfigurableStates();
|
||||
return CommonResponse.success(MessageTemplateV3ConfigStateResponse.cardStateToResp(cardStates));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,15 @@
|
||||
package cn.axzo.msg.center.message.domain.param;
|
||||
|
||||
import cn.axzo.msg.center.common.exception.ServiceException;
|
||||
import cn.axzo.msg.center.service.domain.card.AppVersionConfig;
|
||||
import cn.axzo.msg.center.service.domain.card.StateImageConfig;
|
||||
import cn.axzo.msg.center.service.dto.MessageTemplateButtonV3DTO;
|
||||
import cn.axzo.msg.center.service.dto.MessageTemplateCardJumpV3DTO;
|
||||
import cn.axzo.msg.center.service.enums.MessageCategoryEnum;
|
||||
import cn.axzo.msg.center.service.enums.MessageChannel;
|
||||
import cn.axzo.msg.center.service.enums.PushTerminalEnum;
|
||||
import cn.axzo.msg.center.service.enums.StatusEnum;
|
||||
import cn.axzo.msg.center.service.pending.card.domain.CardElementConfig;
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateGroupV3CreateRequest;
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateV3CreateRequest;
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateV3DeleteRequest;
|
||||
@ -113,6 +117,31 @@ public class MessageTemplateV3SaveOrUpdateParam implements Serializable {
|
||||
*/
|
||||
private StatusEnum status;
|
||||
|
||||
/**
|
||||
* 推送终端/最低版本
|
||||
*/
|
||||
private List<AppVersionConfig> appVersionConfigs;
|
||||
|
||||
/**
|
||||
* 消息通道:IM/待办
|
||||
*/
|
||||
private List<MessageChannel> channels;
|
||||
|
||||
/**
|
||||
* 卡片样式编码
|
||||
*/
|
||||
private String cardStyleCode;
|
||||
|
||||
/**
|
||||
* 卡片样式扩展字段
|
||||
*/
|
||||
private List<CardElementConfig> cardExtFields;
|
||||
|
||||
/**
|
||||
* 配置状态戳
|
||||
*/
|
||||
private List<StateImageConfig> stateImageConfigs;
|
||||
|
||||
/**
|
||||
* 操作者的自然人id
|
||||
*/
|
||||
@ -131,6 +160,7 @@ public class MessageTemplateV3SaveOrUpdateParam implements Serializable {
|
||||
*/
|
||||
private String updatePersonName;
|
||||
|
||||
|
||||
public static MessageTemplateV3SaveOrUpdateParam from(MessageTemplateV3CreateRequest request) {
|
||||
MessageCategoryEnum category = MessageTemplateCategoryUtil
|
||||
.checkAndReturnSubCategory(request.getCategory(), request.getSubCategory())
|
||||
@ -168,6 +198,11 @@ public class MessageTemplateV3SaveOrUpdateParam implements Serializable {
|
||||
.cardJump(request.getCardJump())
|
||||
.pushData(request.getPushData())
|
||||
.status(StatusEnum.ENABLE)
|
||||
.appVersionConfigs(request.getAppVersionConfigs())//推送终端/最低版本
|
||||
.channels(request.getChannels())//消息通道:IM/待办
|
||||
.cardStyleCode(request.getCardStyleCode())//卡片样式编码
|
||||
.cardExtFields(request.getCardExtFields())//卡片样式扩展字段
|
||||
.stateImageConfigs(request.getStateImageConfigs())//配置状态戳
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@ -358,6 +358,16 @@ public class MessageTemplateV3ServiceImpl implements MessageTemplateV3Service {
|
||||
}
|
||||
}
|
||||
template.setStatus(param.getStatus());
|
||||
//推送终端/最低版本
|
||||
template.setAppVersionConfigs(param.getAppVersionConfigs());
|
||||
//消息通道:IM/待办
|
||||
template.setChannels(param.getChannels());
|
||||
//卡片样式编码
|
||||
template.setCardStyleCode(param.getCardStyleCode());
|
||||
//卡片样式扩展字段
|
||||
template.setCardExtFields(param.getCardExtFields());
|
||||
//配置状态戳
|
||||
template.setStateImageConfigs(param.getStateImageConfigs());
|
||||
return template;
|
||||
}
|
||||
|
||||
@ -538,6 +548,16 @@ public class MessageTemplateV3ServiceImpl implements MessageTemplateV3Service {
|
||||
.updatePersonId(record.getUpdatePersonId())
|
||||
.updatePersonName(record.getUpdatePersonName())
|
||||
.pushData(record.getPushData())
|
||||
//推送终端/最低版本
|
||||
.appVersionConfigs(record.getAppVersionConfigs())
|
||||
//消息通道:IM/待办
|
||||
.channels(record.getChannels())
|
||||
//卡片样式编码
|
||||
.cardStyleCode(record.getCardStyleCode())
|
||||
//卡片样式扩展字段
|
||||
.cardExtFields(record.getCardExtFields())
|
||||
//配置状态戳
|
||||
.stateImageConfigs(record.getStateImageConfigs())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@ -83,6 +83,11 @@ public class MessageTemplateButtonV3DTO implements Serializable {
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 按钮动作完成名称(失效名称)
|
||||
*/
|
||||
private String actionPerformedName;
|
||||
|
||||
/**
|
||||
* 标识
|
||||
*/
|
||||
|
||||
@ -17,7 +17,9 @@ public enum MessageCategoryEnum {
|
||||
|
||||
GENERAL_MESSAGE(1, "通知"),
|
||||
BIZ_PENDING_MESSAGE(2, "业务待办"),
|
||||
APPROVAL_PENDING_MESSAGE(3, "审批待办");
|
||||
APPROVAL_PENDING_MESSAGE(3, "审批待办"),
|
||||
IM_MESSAGE_CARD(4, "IM消息卡片"),
|
||||
;
|
||||
|
||||
private final Integer code;
|
||||
private final String message;
|
||||
|
||||
@ -9,6 +9,7 @@ import cn.axzo.msg.center.service.template.request.MessageTemplateV3SyncResponse
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateV3UpdateRequest;
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateV3UpdateStatusRequest;
|
||||
import cn.axzo.msg.center.service.template.response.MessageDetailStyle;
|
||||
import cn.axzo.msg.center.service.template.response.MessageTemplateV3ConfigStateResponse;
|
||||
import cn.axzo.msg.center.service.template.response.MessageTemplateV3DetailResponse;
|
||||
import cn.axzo.msg.center.service.template.response.MessageTemplateV3PageResponse;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
@ -110,4 +111,11 @@ public interface MessageTemplateV3Client {
|
||||
*/
|
||||
@GetMapping(value = "/message/template/v3/list-template-detail-styles", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<List<MessageDetailStyle>> listTemplateDetailStyles();
|
||||
|
||||
/**
|
||||
* 配置状态戳
|
||||
*/
|
||||
@PostMapping(value = "/message/template/config/state", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<List<MessageTemplateV3ConfigStateResponse>> configState();
|
||||
|
||||
}
|
||||
|
||||
@ -1,10 +1,14 @@
|
||||
package cn.axzo.msg.center.service.template.request;
|
||||
|
||||
import cn.axzo.msg.center.service.domain.card.AppVersionConfig;
|
||||
import cn.axzo.msg.center.service.domain.card.StateImageConfig;
|
||||
import cn.axzo.msg.center.service.dto.MessageTemplateButtonV3DTO;
|
||||
import cn.axzo.msg.center.service.dto.MessageTemplateCardJumpV3DTO;
|
||||
import cn.axzo.msg.center.service.enums.MessageCategoryEnum;
|
||||
import cn.axzo.msg.center.service.enums.MessageChannel;
|
||||
import cn.axzo.msg.center.service.enums.MessageGroupCategoryEnum;
|
||||
import cn.axzo.msg.center.service.enums.PushTerminalEnum;
|
||||
import cn.axzo.msg.center.service.pending.card.domain.CardElementConfig;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Getter;
|
||||
@ -17,11 +21,9 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description
|
||||
*
|
||||
* @author cold_blade
|
||||
* @date 2023/9/26
|
||||
* @version 1.0
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2024/10/08
|
||||
* @description 消息模版创建
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
@ -105,6 +107,31 @@ public class MessageTemplateV3CreateRequest implements Serializable {
|
||||
|
||||
private JSONObject pushData;
|
||||
|
||||
/**
|
||||
* 推送终端/最低版本
|
||||
*/
|
||||
private List<AppVersionConfig> appVersionConfigs;
|
||||
|
||||
/**
|
||||
* 消息通道:IM/待办
|
||||
*/
|
||||
private List<MessageChannel> channels;
|
||||
|
||||
/**
|
||||
* 卡片样式编码
|
||||
*/
|
||||
private String cardStyleCode;
|
||||
|
||||
/**
|
||||
* 卡片样式扩展字段
|
||||
*/
|
||||
private List<CardElementConfig> cardExtFields;
|
||||
|
||||
/**
|
||||
* 配置状态戳
|
||||
*/
|
||||
private List<StateImageConfig> stateImageConfigs;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
|
||||
@ -34,6 +34,7 @@ public class MessageTemplateV3PageRequest extends PageRequest implements Seriali
|
||||
* GENERAL_MESSAGE: 通知
|
||||
* BIZ_PENDING_MESSAGE: 业务待办
|
||||
* APPROVAL_PENDING_MESSAGE: 审批待办
|
||||
* IM_MESSAGE_CARD: IM消息卡片
|
||||
*/
|
||||
private Collection<MessageCategoryEnum> categories;
|
||||
/**
|
||||
|
||||
@ -0,0 +1,65 @@
|
||||
package cn.axzo.msg.center.service.template.response;
|
||||
|
||||
import cn.axzo.msg.center.service.enums.CardState;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2024/12/10
|
||||
* @desc 配置状态戳
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MessageTemplateV3ConfigStateResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6772912658753264863L;
|
||||
|
||||
/**
|
||||
* code
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private boolean imageConfigurable;
|
||||
/**
|
||||
* url
|
||||
*/
|
||||
private String defaultImageUrl;
|
||||
|
||||
/**
|
||||
* 对象转换
|
||||
*/
|
||||
public static List<MessageTemplateV3ConfigStateResponse> cardStateToResp(List<CardState> cardStates) {
|
||||
if (CollectionUtils.isEmpty(cardStates)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return cardStates.stream().map(item -> {
|
||||
MessageTemplateV3ConfigStateResponse response = BeanUtil.copyProperties(item, MessageTemplateV3ConfigStateResponse.class);
|
||||
return response;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,14 @@
|
||||
package cn.axzo.msg.center.service.template.response;
|
||||
|
||||
import cn.axzo.msg.center.service.domain.card.AppVersionConfig;
|
||||
import cn.axzo.msg.center.service.domain.card.StateImageConfig;
|
||||
import cn.axzo.msg.center.service.dto.MessageTemplateButtonV3DTO;
|
||||
import cn.axzo.msg.center.service.dto.MessageTemplateCardJumpV3DTO;
|
||||
import cn.axzo.msg.center.service.enums.MessageCategoryEnum;
|
||||
import cn.axzo.msg.center.service.enums.MessageChannel;
|
||||
import cn.axzo.msg.center.service.enums.MessageGroupCategoryEnum;
|
||||
import cn.axzo.msg.center.service.enums.PushTerminalEnum;
|
||||
import cn.axzo.msg.center.service.pending.card.domain.CardElementConfig;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -99,6 +103,33 @@ public class MessageTemplateV3DetailResponse implements Serializable {
|
||||
* 待办样式
|
||||
*/
|
||||
private MessageDetailStyle detailStyle;
|
||||
|
||||
/**
|
||||
* 推送终端/最低版本
|
||||
*/
|
||||
private List<AppVersionConfig> appVersionConfigs;
|
||||
|
||||
/**
|
||||
* 消息通道:IM/待办
|
||||
*/
|
||||
private List<MessageChannel> channels;
|
||||
|
||||
/**
|
||||
* 卡片样式编码
|
||||
*/
|
||||
private String cardStyleCode;
|
||||
|
||||
/**
|
||||
* 卡片样式扩展字段
|
||||
*/
|
||||
private List<CardElementConfig> cardExtFields;
|
||||
|
||||
/**
|
||||
* 配置状态戳
|
||||
*/
|
||||
private List<StateImageConfig> stateImageConfigs;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user