REQ-3045: IM按钮
This commit is contained in:
parent
a97946f52f
commit
915c907616
@ -2,7 +2,6 @@ package cn.axzo.msg.center.inside.notices.service.impl.v3.msg;
|
||||
|
||||
import cn.axzo.msg.center.domain.entity.MessageRecordV3;
|
||||
import cn.axzo.msg.center.message.domain.dto.TemplateModelV3;
|
||||
import cn.axzo.msg.center.message.domain.vo.CardButtonForCms;
|
||||
import cn.axzo.msg.center.message.domain.vo.GeneralMessagePushVO;
|
||||
import cn.axzo.msg.center.message.domain.vo.GeneralMessagePushVO.CardButton;
|
||||
import cn.axzo.msg.center.message.domain.vo.GeneralMessagePushVO.CardExtensionItem;
|
||||
@ -102,11 +101,6 @@ public class MessageTemplateParserV3 {
|
||||
|
||||
@Override
|
||||
public void visitButton(ParsedButtonV3 button) {
|
||||
parseButtonV2(button);
|
||||
parseButtonForCms(button);
|
||||
}
|
||||
|
||||
private void parseButtonV2(ParsedButtonV3 button) {
|
||||
List<ButtonStyleEnum> styles = button.parseStyle();
|
||||
if (!styles.contains(ButtonStyleEnum.OVER_CARD))
|
||||
return;
|
||||
@ -123,28 +117,14 @@ public class MessageTemplateParserV3 {
|
||||
if (RouterCategoryEnum.ACTION.equals(button.getCategory())) {
|
||||
AppLink appLink = new AppLink(TerminalTypeEnum.WEB_VIEW.name(), button.getApiUrl());
|
||||
imButton.setActionPaths(Collections.singletonList(appLink));
|
||||
} else {
|
||||
imButton.setActionPaths(getNativeAppLinks(button.getUrlConfig()));
|
||||
}
|
||||
}
|
||||
|
||||
private void parseButtonForCms(ParsedButtonV3 button) {
|
||||
CardButtonForCms cmsButton = new CardButtonForCms();
|
||||
cmsButton.setTitle(button.getName());
|
||||
cmsButton.setAction(button.getCategory().name());
|
||||
cmsButton.setIsHighlight(button.parseStyle().contains(ButtonStyleEnum.HIGH_LIGHT));
|
||||
cmsButton.setIsOverCard(button.parseStyle().contains(ButtonStyleEnum.OVER_CARD));
|
||||
if (RouterCategoryEnum.ACTION.equals(button.getCategory())) {
|
||||
ParsedUrlForCms urlForCms = new ParsedUrlForCms();
|
||||
urlForCms.setHasManagerAppUrl(true);
|
||||
urlForCms.setUrl(button.getApiUrl());
|
||||
cmsButton.setUrlInfo(urlForCms);
|
||||
imButton.setUrlInfoForCms(urlForCms);
|
||||
} else {
|
||||
cmsButton.setUrlInfo(parseUrlForCms(button.getUrlConfig()));
|
||||
imButton.setActionPaths(getNativeAppLinks(button.getUrlConfig()));
|
||||
imButton.setUrlInfoForCms(parseUrlForCms(button.getUrlConfig()));
|
||||
}
|
||||
if (im.getCardButtonsForCms() == null)
|
||||
im.setCardButtonsForCms(new ArrayList<>());
|
||||
im.getCardButtonsForCms().add(cmsButton);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@ -206,6 +206,8 @@ public class GeneralMessagePushVO implements Serializable {
|
||||
*/
|
||||
private List<AppLink> actionPaths;
|
||||
|
||||
private ParsedUrlForCms urlInfoForCms;
|
||||
|
||||
static CardButton from(MessageTemplateRouterDTO.MessageRouteDetailDTO routeDetail) {
|
||||
return CardButton.builder()
|
||||
.title(routeDetail.getName())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user