package com.bocloud.ims.entity.middleware;

import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreAll;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.Generic;
import com.bocloud.entity.meta.PKStrategy;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 缓存用户
 * 
 * @author weiwei
 * 
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table("kvs_user")
public class KvsUser extends Generic {

	@PK(PKStrategy.AUTO)
	private Long id;// ID
	@Column("username")
	private String username;// 用户名
	@Column("password")
	private String password;// 密码
	@Column("permission")
	private String permission;// 权限
	@Column("kvs_id")
	private Long kvsId;// 缓存服务ID
	@Column("kvs_db_id")
	private Long kvsDbId;// 缓存数据库ID
	@IgnoreAll
	private String newPassword;// 密码
	@IgnoreAll
	private String dbName;

	/**
	 * 
	 * @param username
	 * @param password
	 * @param permission
	 * @param kvsId
	 * @param kvsDbId
	 */
	public KvsUser(String username, String password, String permission, Long kvsId, Long kvsDbId) {
		super();
		this.username = username;
		this.password = password;
		this.permission = permission;
		this.kvsId = kvsId;
		this.kvsDbId = kvsDbId;
	}
}
