Search in sources :

Example 1 with UserStateRequest

use of org.roof.im.request.UserStateRequest in project roof-im by madfroglx.

the class RequestTest method online.

public void online(String token) throws Exception {
    UserStateRequest userStateRequest = new UserStateRequest();
    userStateRequest.setClientType(ClientType.h5.name());
    userStateRequest.setRequestType("online");
    userStateRequest.setToken(token);
    ValueStack valueStack = new GenericValueStack();
    System.out.println(JSON.toJSONString(userStateRequest));
    valueStack.set(ImConstant.TEXT_MESSAGE, JSON.toJSONString(userStateRequest));
    valueStack.set(ImConstant.CONNECT_ID, "1");
    JSONObject jsonObjectMessage = JSON.parseObject(JSON.toJSONString(userStateRequest));
    valueStack.set(ImConstant.JSON_OBJECT_MESSAGE, jsonObjectMessage);
    enterChain.doChain(valueStack);
}
Also used : GenericValueStack(com.roof.chain.support.GenericValueStack) ValueStack(com.roof.chain.api.ValueStack) JSONObject(com.alibaba.fastjson.JSONObject) GenericValueStack(com.roof.chain.support.GenericValueStack) UserStateRequest(org.roof.im.request.UserStateRequest)

Aggregations

JSONObject (com.alibaba.fastjson.JSONObject)1 ValueStack (com.roof.chain.api.ValueStack)1 GenericValueStack (com.roof.chain.support.GenericValueStack)1 UserStateRequest (org.roof.im.request.UserStateRequest)1