Package 

Class ApiHandler

  • All Implemented Interfaces:

    @Component() 
    public final class ApiHandler
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Unit onReceiveApiMessage(JSONObject message) 收到 以前调用的API 的响应
      final JSONObject sendApiMessage(WebSocketSession botSession, IApiRequest apiRequest) 发送自定义API
      final JSONObject sendApiMessage(WebSocketSession botSession, ApiEnum action, JSONObject params) 调用定义好的API
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • onReceiveApiMessage

         final Unit onReceiveApiMessage(JSONObject message)

        收到 以前调用的API 的响应

        Parameters:
        message - 内容
      • sendApiMessage

         final JSONObject sendApiMessage(WebSocketSession botSession, IApiRequest apiRequest)

        发送自定义API

        Parameters:
        botSession - websocketSession
        apiRequest - 自定义请求
      • sendApiMessage

         final JSONObject sendApiMessage(WebSocketSession botSession, ApiEnum action, JSONObject params)

        调用定义好的API

        Parameters:
        botSession - 机器人session
        action - 执行的操作
        params - 参数