
package org.tio.sitexxx.im.common;

import cn.hutool.core.lang.Snowflake;
import org.tio.core.intf.TioUuid;

/**
 * @author tanyaowu
 * 2016年6月5日 上午10:44:26
 */
public class ImTioUuid implements TioUuid {
	private Snowflake snowflake;

	/**
	 *
	 * @author tanyaowu
	 */
	public ImTioUuid(long workerId, long datacenterId) {
		snowflake = new Snowflake(workerId, datacenterId);
	}

	/**
	 * @return
	 * @author tanyaowu
	 */
	@Override
	public String uuid() {
		return snowflake.nextId() + "";
	}
}
