public class WeChatTemplateMessageBot extends Object implements BotService
Modifier and Type | Field and Description |
---|---|
protected ConversationPermissionService |
conversationPermissionService |
protected ConversationService |
conversationService |
protected JmsMessageOperations |
jmsMessagingOperations |
protected MessageService |
messageService |
protected PlatformIdentityService |
platformIdentityService |
protected TemplateService |
templateService |
protected UserAccountService |
userAccountService |
static String |
WECHAT_TEMPLATE_ACTION_DEFINITION_KEY |
static String |
WECHAT_TEMPLATE_KEY |
protected WeChatProperties |
weChatProperties |
Constructor and Description |
---|
WeChatTemplateMessageBot(TemplateService templateService,
ConversationService conversationService,
ConversationPermissionService conversationPermissionService,
MessageService messageService,
PlatformIdentityService platformIdentityService,
JmsMessageOperations jmsMessageOperations,
WeChatProperties weChatProperties,
UserAccountService userAccountService) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkTemplateParametersSize(Map<String,String> templateParameters)
Check if the total size of all the template parameters do not exceed the maximum allowed size which is given by WeChat.
|
protected Map<String,String> |
extractTemplateParameters(List<TemplateParameter> templateParameters,
Map<String,Object> payload)
Extract all the template parameters from the payload.
|
String |
getDescription() |
String |
getKey() |
String |
getName() |
BotActionResult |
invokeBot(HistoricActionInstance actionInstance,
ActionDefinition actionDefinition,
Map<String,Object> payload) |
public static final String WECHAT_TEMPLATE_KEY
public static final String WECHAT_TEMPLATE_ACTION_DEFINITION_KEY
protected final TemplateService templateService
protected final ConversationService conversationService
protected final ConversationPermissionService conversationPermissionService
protected final MessageService messageService
protected final PlatformIdentityService platformIdentityService
protected final JmsMessageOperations jmsMessagingOperations
protected final WeChatProperties weChatProperties
protected final UserAccountService userAccountService
public WeChatTemplateMessageBot(TemplateService templateService, ConversationService conversationService, ConversationPermissionService conversationPermissionService, MessageService messageService, PlatformIdentityService platformIdentityService, JmsMessageOperations jmsMessageOperations, WeChatProperties weChatProperties, UserAccountService userAccountService)
public String getKey()
getKey
in interface BotService
public String getName()
getName
in interface BotService
public String getDescription()
getDescription
in interface BotService
public BotActionResult invokeBot(HistoricActionInstance actionInstance, ActionDefinition actionDefinition, Map<String,Object> payload)
invokeBot
in interface BotService
protected Map<String,String> extractTemplateParameters(List<TemplateParameter> templateParameters, Map<String,Object> payload)
templateParameters
- payload
-