REQ-3282: 更新卡片失败时,回滚数据

This commit is contained in:
yanglin 2024-12-23 14:45:27 +08:00
parent 716ae6d401
commit f77bc5c269

View File

@ -47,7 +47,14 @@ class CardParser {
GeneralMessagePushVO parseCardContent(CardTemplate cardTemplate, CardContent card) {
ParsedTemplateV3 template = cardTemplate.getTemplate();
GeneralMessagePushVO bizBody = new GeneralMessagePushVO();
boolean isDebugBizBody = cardProps.isDebugBizBody();
GeneralMessagePushVO bizBody = new GeneralMessagePushVO() {
@Override
public void addDebugInfo(String name, Object value) {
if (isDebugBizBody)
super.addDebugInfo(name, value);
}
};
bizBody.setCardStyleCode(template.getCardStyleCode());
bizBody.setTemplateCode(template.getCode());
bizBody.setCardBannerUrl(template.getIcon());
@ -66,11 +73,9 @@ class CardParser {
subtitle.setTitle(card.getSubtitle());
bizBody.setSubtitles(Collections.singletonList(subtitle));
}
if (cardProps.isDebugBizBody()) {
bizBody.addDebugInfo("bizState", stateInfo.getBizState());
bizBody.addDebugInfo("cardState", stateInfo.getCardState());
bizBody.addDebugInfo("isUpdatable", cardTemplate.isUpdatable());
}
ParsedModelV3Walker.walkDown(cardTemplate.getParsedModel(), new ParsedModel3Visitor() {
@Override
public void visitTemplateCardUrlConfig(UrlConfig urlConfig) {