REQ-3502: 添加bizCode和subBizCode
This commit is contained in:
parent
4262c825d0
commit
486892cbf8
@ -250,7 +250,7 @@ public class CardManager {
|
||||
}));
|
||||
}
|
||||
|
||||
private void rebuildCardContent(TemplateModelV3 templateModel, List<Card> cards) {
|
||||
void rebuildCardContent(TemplateModelV3 templateModel, List<Card> cards) {
|
||||
ArrayList<Card> updates = new ArrayList<>();
|
||||
for (Card card : cardDao.reloadCards(cards)) {
|
||||
Card update = new Card();
|
||||
|
||||
@ -6,7 +6,9 @@ import cn.axzo.msg.center.service.enums.TerminalTypeEnum;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
@ -15,6 +17,7 @@ import java.util.List;
|
||||
public class NativeAppLinkUrlConfigVisitor implements UrlConfigVisitor {
|
||||
|
||||
private final List<AppLink> links = new ArrayList<>();
|
||||
private final Set<TerminalTypeEnum> terminals = new HashSet<>();
|
||||
|
||||
@Override
|
||||
public void visitAppManagerAndroid(AppUrl android) {
|
||||
@ -41,7 +44,9 @@ public class NativeAppLinkUrlConfigVisitor implements UrlConfigVisitor {
|
||||
}
|
||||
|
||||
private void addLink(AppLink link) {
|
||||
if (!links.contains(link))
|
||||
if (!terminals.contains(link.getPlatform())) {
|
||||
links.add(link);
|
||||
terminals.add(link.getPlatform());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,16 @@
|
||||
package cn.axzo.msg.center.message.service.card;
|
||||
|
||||
import cn.axzo.msg.center.MsgCenterApplication;
|
||||
import cn.axzo.msg.center.common.utils.BizAssertions;
|
||||
import cn.axzo.msg.center.dal.CardDao;
|
||||
import cn.axzo.msg.center.domain.entity.Card;
|
||||
import cn.axzo.msg.center.message.domain.dto.TemplateModelV3;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
@ -24,6 +26,9 @@ class CardManagerTest {
|
||||
@Test
|
||||
void rebuildCardContent() {
|
||||
TemplateModelV3 templateModel = cardSupport.ensureImChannelPresent("a7c79c432efc4ecba71790677d35cc59");
|
||||
Card card = cardDao.findCardByBizMessageId("e4b81f64cd854e3e92a6cad8f1546760").orElse(null);
|
||||
BizAssertions.assertNotNull(card, "card not found");
|
||||
cardManager.rebuildCardContent(templateModel, Collections.singletonList(card));
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user