Java wechat public platform development (9) keyword reply and customer service interface implementation

WeChat official account shows that WeChat has made two models for us. One is the developer mode (that is, the development we have been doing), and the other is the editing mode. However, it is painful that some functions cannot be used once we switch to the developer mode. The more typical ones are keyword reply and return when the server does not respond [the server cannot respond] and other problems. The solutions I give here are: ① code implementation of keyword reply for keywords; ② [server 5S no response] solution is to access multiple customer service to facilitate our message processing!

(1) Keyword auto reply

In the previous article, we have completed the classification and implementation of message reply. The keyword reply here is only the application of message reply function, Here I implement it under [text type message]. The general idea is: first get the content of the message text, then get the content to match the keywords you need to set, and then give different message replies according to the matching results. The simple code is as follows:

The logic of basic keyword reply is like this. You can set your own keywords and implementation process according to your own needs. The final operation results are as follows:

(two) the official account is temporarily unable to provide service solutions - Multi customer service interface.

In our use or development process, we may encounter the reply that the official account is temporarily unable to provide services. The reason for this recovery is that our application service failed to give any response to the Tencent server in 5S, and the automatic response hints from the Tencent server to the users, how to solve them and avoid the occurrence of such a situation, we can have the following solutions:

① Reply [empty] directly to the wechat server. Note that the reply here is empty, not empty!

Therefore, our code is implemented as follows:

② Transfer the message to multiple customer service assistants and let the customer service handle the message! Create a customer service message entity class customermessage Java, the simple code is as follows:

Then add the message forwarding code where we need to reply, as follows:

In this way, the messages sent by users can be forwarded to multiple customer service assistants, so that our customer service personnel can respond accordingly to facilitate our message processing! The related use and download of multiple customer service can be viewed http://mp.weixin.qq.com/wiki/11/f0e34a15cec66fefb28cf1c0388f68ab.html 。

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>