package com.data.cache;

import com.data.bean.BaseBean;
import com.data.bean.GroupMemberBean;

public class GroupMemberCache extends BaseCache{
	private static final String MAIN_KEY= "join_time";
	private int						groupId;

	public GroupMemberCache(int gid) {
		super("g{"+gid+"}:m", "group1_db10");
		this.groupId = gid;
		this.readTime = 0;
	}

	@Override
	protected BaseBean newBean() {
		return new GroupMemberBean(groupId);
	}

	/**
	 * 主键KEY
	 * @return
	 */
	protected String mainKey() {
		return MAIN_KEY;
	}
	
	public static String genKey(int gid, int uid) {
		return String.format("g{%s}:m%s", gid, uid);
	}
}
