feat:(REQ-3201) 1 卡片样式-新增/编辑/删除/详情/分页;2 模版管理中的编辑新增字段
This commit is contained in:
parent
68386bd46e
commit
d5bf562a70
@ -0,0 +1,73 @@
|
||||
package cn.axzo.msg.center.message.controller;
|
||||
|
||||
import cn.axzo.msg.center.message.domain.param.CardStyleSaveOrUpdateParam;
|
||||
import cn.axzo.msg.center.message.domain.param.MessageTemplateV3SaveOrUpdateParam;
|
||||
import cn.axzo.msg.center.message.service.CardStyleService;
|
||||
import cn.axzo.msg.center.service.card.request.CardStyleCreateRequest;
|
||||
import cn.axzo.msg.center.service.card.request.CardStyleDeleteRequest;
|
||||
import cn.axzo.msg.center.service.card.request.CardStylePageRequest;
|
||||
import cn.axzo.msg.center.service.card.request.CardStyleUpdateRequest;
|
||||
import cn.axzo.msg.center.service.card.response.CardStyleDetailResponse;
|
||||
import cn.axzo.msg.center.service.card.response.CardStylePageResponse;
|
||||
import cn.axzo.msg.center.service.template.client.CardStyleClient;
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateV3CreateRequest;
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateV3DeleteRequest;
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateV3PageRequest;
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateV3UpdateRequest;
|
||||
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 com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 卡片样式
|
||||
*
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2024/12/10
|
||||
* @version 1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class CardStyleController implements CardStyleClient {
|
||||
|
||||
private final CardStyleService cardStyleService;
|
||||
|
||||
@Override
|
||||
public CommonResponse<String> save(CardStyleCreateRequest request) {
|
||||
log.info("CardStyleController#save,request:{}", JSON.toJSONString(request));
|
||||
return CommonResponse.success(
|
||||
cardStyleService.createCardStyle(CardStyleSaveOrUpdateParam.from(request)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Void> update(CardStyleUpdateRequest request) {
|
||||
log.info("CardStyleController#update,request:{}", JSON.toJSONString(request));
|
||||
cardStyleService.updateCardStyle(CardStyleSaveOrUpdateParam.from(request));
|
||||
return CommonResponse.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Void> delete(CardStyleDeleteRequest request) {
|
||||
log.info("CardStyleController#delete,request:{}", JSON.toJSONString(request));
|
||||
cardStyleService.deleteCardStyle(CardStyleSaveOrUpdateParam.from(request));
|
||||
return CommonResponse.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<CardStyleDetailResponse> detail(String code) {
|
||||
log.info("CardStyleController#detail,code:{}", code);
|
||||
return CommonResponse.success(cardStyleService.detail(code));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Page<CardStylePageResponse>> page(CardStylePageRequest request) {
|
||||
log.info("CardStyleController#page,request:{}", JSON.toJSONString(request));
|
||||
return CommonResponse.success(cardStyleService.page(request));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,112 @@
|
||||
package cn.axzo.msg.center.message.domain.param;
|
||||
|
||||
import cn.axzo.msg.center.common.exception.ServiceException;
|
||||
import cn.axzo.msg.center.domain.entity.CardStyle;
|
||||
import cn.axzo.msg.center.domain.utils.StringListTypeHandler;
|
||||
import cn.axzo.msg.center.service.card.request.CardStyleCreateRequest;
|
||||
import cn.axzo.msg.center.service.card.request.CardStyleDeleteRequest;
|
||||
import cn.axzo.msg.center.service.card.request.CardStyleUpdateRequest;
|
||||
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;
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateV3UpdateRequest;
|
||||
import cn.axzo.msg.center.service.template.response.MessageTemplateV3DetailResponse;
|
||||
import cn.axzo.msg.center.utils.MessageTemplateCategoryUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description
|
||||
*
|
||||
* @author cold_blade
|
||||
* @date 2023/10/5
|
||||
* @version 1.0
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CardStyleSaveOrUpdateParam implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6657624182580261353L;
|
||||
|
||||
/**
|
||||
* 样式名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 样式code, 唯一
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 预览大图
|
||||
*/
|
||||
private List<String> previewImages;
|
||||
|
||||
/**
|
||||
* 卡片元素配置
|
||||
*/
|
||||
private List<CardElementConfig> elementConfigs;
|
||||
|
||||
|
||||
public static CardStyleSaveOrUpdateParam from(CardStyleCreateRequest request) {
|
||||
|
||||
return CardStyleSaveOrUpdateParam.builder()
|
||||
.name(request.getName())
|
||||
.code(request.getCode())
|
||||
.previewImages(request.getPreviewImages())
|
||||
.elementConfigs(request.getElementConfigs())
|
||||
.build();
|
||||
}
|
||||
|
||||
public CardStyle toEntityWhenCreate(String code) {
|
||||
CardStyle cardStyle = new CardStyle();
|
||||
cardStyle.setName(this.getName());
|
||||
cardStyle.setCode(code);
|
||||
cardStyle.setPreviewImages(this.getPreviewImages());
|
||||
cardStyle.setElementConfigs(this.getElementConfigs());
|
||||
return cardStyle;
|
||||
}
|
||||
|
||||
public static CardStyleSaveOrUpdateParam from(CardStyleUpdateRequest request) {
|
||||
return CardStyleSaveOrUpdateParam.builder()
|
||||
.name(request.getName())
|
||||
.code(request.getCode())
|
||||
.previewImages(request.getPreviewImages())
|
||||
.elementConfigs(request.getElementConfigs())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static CardStyleSaveOrUpdateParam from(CardStyleDeleteRequest request) {
|
||||
return CardStyleSaveOrUpdateParam.builder()
|
||||
.code(request.getCode())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package cn.axzo.msg.center.message.service;
|
||||
|
||||
import cn.axzo.msg.center.message.domain.param.CardStyleSaveOrUpdateParam;
|
||||
import cn.axzo.msg.center.message.domain.param.MessageTemplateV3SaveOrUpdateParam;
|
||||
import cn.axzo.msg.center.service.card.request.CardStylePageRequest;
|
||||
import cn.axzo.msg.center.service.card.response.CardStyleDetailResponse;
|
||||
import cn.axzo.msg.center.service.card.response.CardStylePageResponse;
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateV3PageRequest;
|
||||
import cn.axzo.msg.center.service.template.response.MessageTemplateV3DetailResponse;
|
||||
import cn.axzo.msg.center.service.template.response.MessageTemplateV3PageResponse;
|
||||
import cn.azxo.framework.common.model.Page;
|
||||
|
||||
/**
|
||||
* @description 卡片样式管理
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2024/12/10
|
||||
*/
|
||||
public interface CardStyleService {
|
||||
|
||||
/**
|
||||
* 创建卡片样式
|
||||
*
|
||||
* @param param 卡片样式内容参数
|
||||
*/
|
||||
String createCardStyle(CardStyleSaveOrUpdateParam param);
|
||||
|
||||
/**
|
||||
* 编辑卡片样式
|
||||
*
|
||||
* @param param 卡片样式内容参数
|
||||
*/
|
||||
void updateCardStyle(CardStyleSaveOrUpdateParam param);
|
||||
|
||||
/**
|
||||
* 删除模版
|
||||
*/
|
||||
void deleteCardStyle(CardStyleSaveOrUpdateParam param);
|
||||
|
||||
/**
|
||||
* 通过模板便阿门查询模板详情
|
||||
*
|
||||
* @param templateCode 模板编码
|
||||
* @return 模板详情信息
|
||||
*/
|
||||
CardStyleDetailResponse detail(String templateCode);
|
||||
|
||||
/**
|
||||
* 分页查询模板数据
|
||||
*
|
||||
* @param request 分页请求参数
|
||||
* @return 模板数据列表
|
||||
*/
|
||||
Page<CardStylePageResponse> page(CardStylePageRequest request);
|
||||
}
|
||||
@ -0,0 +1,143 @@
|
||||
package cn.axzo.msg.center.message.service.impl;
|
||||
|
||||
import cn.axzo.msg.center.common.enums.TableIsDeleteEnum;
|
||||
import cn.axzo.msg.center.common.utils.BizAssertions;
|
||||
import cn.axzo.msg.center.common.utils.PageHelperUtil;
|
||||
import cn.axzo.msg.center.dal.CardStyleDao;
|
||||
import cn.axzo.msg.center.domain.entity.CardStyle;
|
||||
import cn.axzo.msg.center.message.domain.param.CardStyleSaveOrUpdateParam;
|
||||
import cn.axzo.msg.center.message.service.CardStyleService;
|
||||
import cn.axzo.msg.center.service.card.request.CardStylePageRequest;
|
||||
import cn.axzo.msg.center.service.card.response.CardStyleDetailResponse;
|
||||
import cn.axzo.msg.center.service.card.response.CardStylePageResponse;
|
||||
import cn.axzo.msg.center.service.enums.YesOrNo;
|
||||
import cn.axzo.msg.center.utils.UUIDUtil;
|
||||
import cn.azxo.framework.common.model.Page;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2024/12/10
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CardStyleServiceImpl implements CardStyleService {
|
||||
|
||||
|
||||
private final CardStyleDao cardStyleDao;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String createCardStyle(CardStyleSaveOrUpdateParam param) {
|
||||
log.info("CardStyleServiceImpl#createCardStyle,param:{}", JSON.toJSONString(param));
|
||||
String code = UUIDUtil.uuidString();
|
||||
CardStyle cardStyle = param.toEntityWhenCreate(code);
|
||||
cardStyleDao.save(cardStyle);
|
||||
return code;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateCardStyle(CardStyleSaveOrUpdateParam param) {
|
||||
log.info("CardStyleServiceImpl#updateTemplate,param:{}", JSON.toJSONString(param));
|
||||
//1 更新卡片样式
|
||||
doUpdateCardStyle(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteCardStyle(CardStyleSaveOrUpdateParam param) {
|
||||
log.info("CardStyleServiceImpl#delete,param:{}", JSON.toJSONString(param));
|
||||
if (Objects.isNull(param) || StringUtils.isBlank(param.getCode())) {
|
||||
log.info("code is blank");
|
||||
return;
|
||||
}
|
||||
cardStyleDao.lambdaUpdate()
|
||||
.eq(CardStyle::getCode, param.getCode())
|
||||
.eq(CardStyle::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.set(CardStyle::getIsDelete, YesOrNo.NO.getCode())
|
||||
.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CardStyleDetailResponse detail(String code) {
|
||||
log.info("MessageTemplateV3ServiceImpl#detail,code:{}", code);
|
||||
if (StringUtils.isBlank(code)) {
|
||||
return null;
|
||||
}
|
||||
CardStyle cardStyle = cardStyleDao.lambdaQuery()
|
||||
.eq(CardStyle::getCode, code)
|
||||
.eq(CardStyle::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.one();
|
||||
if (Objects.isNull(cardStyle)) {
|
||||
log.info("there is not any cardstyle match the templateCode:[{}]", code);
|
||||
return null;
|
||||
}
|
||||
|
||||
return convert(cardStyle);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对象转换
|
||||
*/
|
||||
private CardStyleDetailResponse convert(CardStyle cardStyle) {
|
||||
return CardStyleDetailResponse.builder()
|
||||
.name(cardStyle.getName())
|
||||
.code(cardStyle.getCode())
|
||||
.previewImages(cardStyle.getPreviewImages())
|
||||
.elementConfigs(cardStyle.getElementConfigs())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Page<CardStylePageResponse> page(CardStylePageRequest request) {
|
||||
IPage<CardStyle> result = pageQueryCardStyle(request);
|
||||
if (Objects.isNull(result)
|
||||
|| CollectionUtils.isEmpty(result.getRecords())) {
|
||||
return PageHelperUtil.emptyPage(request.getPage(), request.getPageSize());
|
||||
}
|
||||
|
||||
List<CardStylePageResponse> responses = BeanUtil.copyToList(result.getRecords(), CardStylePageResponse.class);
|
||||
return Page.toPage(request.getPage(), request.getPageSize(), result.getTotal(), responses);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行更新
|
||||
*/
|
||||
private void doUpdateCardStyle(CardStyleSaveOrUpdateParam param) {
|
||||
boolean updated = cardStyleDao.lambdaUpdate()
|
||||
.eq(CardStyle::getCode, param.getCode())
|
||||
.eq(CardStyle::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.set(StringUtils.isNotBlank(param.getName()), CardStyle::getName, param.getName())
|
||||
//预览大图
|
||||
.set(CollectionUtils.isNotEmpty(param.getPreviewImages()), CardStyle::getPreviewImages, JSON.toJSONString(param.getPreviewImages()))
|
||||
//卡片元素配置
|
||||
.set(CollectionUtils.isNotEmpty(param.getElementConfigs()), CardStyle::getElementConfigs, JSON.toJSONString(param.getElementConfigs()))
|
||||
.update();
|
||||
BizAssertions.assertTrue(updated, "卡片样式不存在:", param.getCode());
|
||||
}
|
||||
|
||||
private IPage<CardStyle> pageQueryCardStyle(CardStylePageRequest request) {
|
||||
IPage<CardStyle> pageRequest = request.toPage();
|
||||
|
||||
return cardStyleDao.lambdaQuery()
|
||||
.eq(StringUtils.isNotBlank(request.getCode()), CardStyle::getCode, request.getCode())
|
||||
.eq(StringUtils.isNotBlank(request.getName()), CardStyle::getName, request.getName())
|
||||
.orderByDesc(CardStyle::getCreateAt)
|
||||
.page(pageRequest);
|
||||
}
|
||||
|
||||
}
|
||||
@ -394,6 +394,16 @@ public class MessageTemplateV3ServiceImpl implements MessageTemplateV3Service {
|
||||
.set(MessageTemplateV3::getMinAppVersion, param.getMinAppVersion())
|
||||
.set(Objects.nonNull(pushData), MessageTemplateV3::getPushData,
|
||||
pushData == null ? null : pushData.toJSONString())
|
||||
//推送终端/最低版本
|
||||
.set(CollectionUtils.isNotEmpty(param.getAppVersionConfigs()), MessageTemplateV3::getAppVersionConfigs, JSON.toJSONString(param.getAppVersionConfigs()))
|
||||
//消息通道:IM/待办
|
||||
.set(CollectionUtils.isNotEmpty(param.getChannels()), MessageTemplateV3::getChannels, JSON.toJSONString(param.getChannels()))
|
||||
//卡片样式编码
|
||||
.set(StringUtils.isNotBlank(param.getCardStyleCode()), MessageTemplateV3::getCardStyleCode, param.getCardStyleCode())
|
||||
//卡片样式扩展字段
|
||||
.set(CollectionUtils.isNotEmpty(param.getCardExtFields()), MessageTemplateV3::getCardExtFields, JSON.toJSONString(param.getCardExtFields()))
|
||||
//配置状态戳
|
||||
.set(CollectionUtils.isNotEmpty(param.getStateImageConfigs()), MessageTemplateV3::getStateImageConfigs, JSON.toJSONString(param.getStateImageConfigs()))
|
||||
.update();
|
||||
BizAssertions.assertTrue(updated, "模版不存在:", param.getTemplateCode());
|
||||
}
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
package cn.axzo.msg.center.service.card.request;
|
||||
|
||||
import cn.axzo.msg.center.service.pending.card.domain.CardElementConfig;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2024/10/08
|
||||
* @description 消息模版创建
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class CardStyleCreateRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2894419272913799317L;
|
||||
|
||||
/**
|
||||
* 样式名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 样式code, 唯一
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 预览大图
|
||||
*/
|
||||
private List<String> previewImages;
|
||||
|
||||
/**
|
||||
* 卡片元素配置
|
||||
*/
|
||||
private List<CardElementConfig> elementConfigs;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package cn.axzo.msg.center.service.card.request;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2024/12/10
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class CardStyleDeleteRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2894419272913799317L;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package cn.axzo.msg.center.service.card.request;
|
||||
|
||||
import cn.axzo.basics.common.page.PageRequest;
|
||||
import cn.axzo.msg.center.service.enums.MessageCategoryEnum;
|
||||
import cn.axzo.msg.center.service.enums.StatusEnum;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2024/12/10
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class CardStylePageRequest extends PageRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 3501567663122621175L;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 模板编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package cn.axzo.msg.center.service.card.request;
|
||||
|
||||
import cn.axzo.msg.center.service.pending.card.domain.CardElementConfig;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description
|
||||
*
|
||||
* @author cold_blade
|
||||
* @date 2023/10/11
|
||||
* @version 1.0
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class CardStyleUpdateRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2894419272913799317L;
|
||||
|
||||
/**
|
||||
* 样式名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 预览大图
|
||||
*/
|
||||
private List<String> previewImages;
|
||||
|
||||
/**
|
||||
* 卡片元素配置
|
||||
*/
|
||||
private List<CardElementConfig> elementConfigs;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package cn.axzo.msg.center.service.card.response;
|
||||
|
||||
import cn.axzo.msg.center.service.pending.card.domain.CardElementConfig;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2024/12/10
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CardStyleDetailResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6772912658753264863L;
|
||||
|
||||
/**
|
||||
* 样式名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 样式code, 唯一
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 预览大图
|
||||
*/
|
||||
private List<String> previewImages;
|
||||
|
||||
/**
|
||||
* 卡片元素配置
|
||||
*/
|
||||
private List<CardElementConfig> elementConfigs;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package cn.axzo.msg.center.service.card.response;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author xudawei@axzo.cn
|
||||
* @date 2024/12/10
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class CardStylePageResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4748193413608569743L;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package cn.axzo.msg.center.service.template.client;
|
||||
|
||||
import cn.axzo.msg.center.service.card.request.CardStyleCreateRequest;
|
||||
import cn.axzo.msg.center.service.card.request.CardStyleDeleteRequest;
|
||||
import cn.axzo.msg.center.service.card.request.CardStylePageRequest;
|
||||
import cn.axzo.msg.center.service.card.request.CardStyleUpdateRequest;
|
||||
import cn.axzo.msg.center.service.card.response.CardStyleDetailResponse;
|
||||
import cn.axzo.msg.center.service.card.response.CardStylePageResponse;
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateV3CreateRequest;
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateV3DeleteRequest;
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateV3PageRequest;
|
||||
import cn.axzo.msg.center.service.template.request.MessageTemplateV3UpdateRequest;
|
||||
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 org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 卡片样式
|
||||
*/
|
||||
@Component
|
||||
@FeignClient(value = "msg-center", url = "${server.serviceUrl:http://msg-center:8080}")
|
||||
public interface CardStyleClient {
|
||||
|
||||
|
||||
/**
|
||||
* 添加卡片样式
|
||||
*
|
||||
* @param request 卡片样式数据模型
|
||||
* @return 编码
|
||||
*/
|
||||
@PostMapping(value = "/card/style/add", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<String> save(@RequestBody @Valid CardStyleCreateRequest request);
|
||||
|
||||
/**
|
||||
* 编辑卡片样式
|
||||
*
|
||||
* @param request 卡片样式数据模型
|
||||
*/
|
||||
@PostMapping(value = "/card/style/update", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<Void> update(@RequestBody @Valid CardStyleUpdateRequest request);
|
||||
|
||||
/**
|
||||
* 删除卡片样式
|
||||
*/
|
||||
@PostMapping(value = "/card/style/delete", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<Void> delete(CardStyleDeleteRequest request);
|
||||
|
||||
/**
|
||||
* 消息模板详情
|
||||
*
|
||||
* @param templateCode 消息模板编码
|
||||
* @return 消息模板详情
|
||||
*/
|
||||
@PostMapping(value = "/card/style/detail", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<CardStyleDetailResponse> detail(@RequestParam("templateCode") String templateCode);
|
||||
|
||||
/**
|
||||
* 分页查询模板
|
||||
*
|
||||
* @param request 分页查询参数
|
||||
* @return 模板列表
|
||||
*/
|
||||
@PostMapping(value = "/card/style/page", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<Page<CardStylePageResponse>> page(CardStylePageRequest request);
|
||||
|
||||
|
||||
}
|
||||
@ -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;
|
||||
@ -109,6 +113,31 @@ public class MessageTemplateV3UpdateRequest 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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user