@Autowired
private ChatRoomSocketHandler socketHandler;
public void login(Serializable userId) throws UserIdRepeatException {
if (this.socketHandler.hasId(userId)) {
throw new UserIdRepeatException();
}
// 登录了给所有在线的人发广播
JSONObject message = new JSONObject();
message.put(COMMAND_KEY, COMMAND_LOGIN);
message.put("userId", userId);