Class WhatsAppService
java.lang.Object
com.bytedesk.social.whatsapp.config.WhatsAppService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.fasterxml.jackson.databind.ObjectMapperprivate final org.springframework.web.client.RestTemplateprivate final WhatsAppConfig -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprocessMessageChange(com.fasterxml.jackson.databind.JsonNode value) voidProcess incoming webhook event from WhatsAppvoidprocessWebhookEvent(String rawBody) Process incoming webhook event from WhatsApp (raw JSON string)voidsendTextMessage(String to, String text) Send text message to WhatsApp userboolean设置WhatsApp Business ProfilebooleanverifyWebhook(String mode, String verifyToken, String challenge) Verify webhook token
-
Field Details
-
whatsAppConfig
-
restTemplate
private final org.springframework.web.client.RestTemplate restTemplate -
objectMapper
private final com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Constructor Details
-
WhatsAppService
public WhatsAppService()
-
-
Method Details
-
sendTextMessage
Send text message to WhatsApp user -
processWebhookEvent
Process incoming webhook event from WhatsApp -
verifyWebhook
Verify webhook token -
processWebhookEvent
Process incoming webhook event from WhatsApp (raw JSON string) -
processMessageChange
private void processMessageChange(com.fasterxml.jackson.databind.JsonNode value) -
setBusinessProfile
public boolean setBusinessProfile()设置WhatsApp Business Profile
-