struct UserId {
  1: string uid,
  2: string type,
  3: optional string clientType,
  4: optional string token
}

exception error{
  1:i32 type
  2:string message
}


typedef list<UserId> ( cpp.template = "std::list" ) UserIdCollection


service MessageService {
  void online(1: UserId userId) throws(1:error error)
  void offline(1: UserId userId) throws(1:error error)
  void keepAlive(1: UserId userId) throws(1:error error)
  void sendMessage(1: UserId userId, 2:i16 cmd, 3: string message) throws(1:error error)
  void sendMessageToUserIdCollection(1: UserIdCollection userIdCollection, 2:i16 cmd, 3: string message) throws(1:error error)
  list<bool> getUserOnlineStatus(1: UserIdCollection userIdCollection) throws(1:error error)
  void sendMessageWithOneOfflineMessage(1: UserIdCollection userIdCollection, 2:i16 cmd, 3: string message) throws(1:error error)
  void sendMessageToRoom(1: string nsp, 2: string room, 3:i16 cmd, 4: string message) throws(1:error error)
}
