REQ-3045: IM按钮

This commit is contained in:
yanglin 2024-10-28 14:45:49 +08:00
parent c53d0fda80
commit 9275e42828

View File

@ -134,7 +134,14 @@ public class MessageTemplateParserV3 {
cmsButton.setAction(button.getCategory().name());
cmsButton.setIsHighlight(button.parseStyle().contains(ButtonStyleEnum.HIGH_LIGHT));
cmsButton.setIsOverCard(button.parseStyle().contains(ButtonStyleEnum.OVER_CARD));
cmsButton.setUrlInfo(parseUrlForCms(button.getUrlConfig()));
if (RouterCategoryEnum.ACTION.equals(button.getCategory())) {
ParsedUrlForCms urlForCms = new ParsedUrlForCms();
urlForCms.setHasManagerAppUrl(true);
urlForCms.setUrl(button.getApiUrl());
cmsButton.setUrlInfo(urlForCms);
} else {
cmsButton.setUrlInfo(parseUrlForCms(button.getUrlConfig()));
}
if (im.getCardButtonsForCms() == null)
im.setCardButtonsForCms(new ArrayList<>());
im.getCardButtonsForCms().add(cmsButton);
@ -145,6 +152,7 @@ public class MessageTemplateParserV3 {
}
private static ParsedUrlForCms parseUrlForCms(UrlConfig urlConfig) {
if (urlConfig == null) return null;
ParsedUrlForCms urlForCms = new ParsedUrlForCms();
urlForCms.setUrl(urlForCms.getUrl());
UrlConfigWalker.walkDown(urlConfig, new UrlConfigVisitor() {