/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.lightinit.hsdatagateway.modules.gateway.entity;

import com.lightinit.hsdatagateway.common.persistence.DataVo;
import org.hibernate.validator.constraints.Length;
import com.lightinit.hsdatagateway.modules.sys.entity.User;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.lightinit.hsdatagateway.common.persistence.DataEntity;

/**
 * 黑白名单
 * @Author: yangrui
 * @version 2019-03-05
 */
public class BlackWhiteList extends DataEntity<BlackWhiteList> {
	
	private static final long serialVersionUID = 1L;

	/**
	 * 名单类型（黑名单/白名单）
	 */
	private String listType;
	/**
	 * IP
	 */
	private String ip;
	/**
	 * 用户ID
	 */
	private String userId;
	/**
	 * 生效时间
	 */
	private Date effectiveTime;
	/**
	 * 过期时间
	 */
	private Date expiredTime;

	/**
	 * 创建时间
	 */
	private Date createdAt;

	/**
	 * 创建人
	 */
	private String createdBy;

	/**
	 * 删除时间
	 */
	private Date deletedAt;

	/**
	 * 删除人
	 */
	private String deletedBy;
	
	public BlackWhiteList() {
		super();
	}

	public BlackWhiteList(Long id){
		super(id);
	}

	public BlackWhiteList(String listType) {
		this.listType = listType;
	}

	@Length(min=0, max=64, message="名单类型（黑名单/白名单）长度必须介于 0 和 64 之间")
	public String getListType() {
		return listType;
	}

	public void setListType(String listType) {
		this.listType = listType;
	}
	
	@Length(min=0, max=255, message="IP长度必须介于 0 和 255 之间")
	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}
	
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getEffectiveTime() {
		return effectiveTime;
	}

	public void setEffectiveTime(Date effectiveTime) {
		this.effectiveTime = effectiveTime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getExpiredTime() {
		return expiredTime;
	}

	public void setExpiredTime(Date expiredTime) {
		this.expiredTime = expiredTime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}
	
	@Length(min=0, max=255, message="创建人长度必须介于 0 和 255 之间")
	public String getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getDeletedAt() {
		return deletedAt;
	}

	public void setDeletedAt(Date deletedAt) {
		this.deletedAt = deletedAt;
	}
	
	@Length(min=0, max=255, message="删除人长度必须介于 0 和 255 之间")
	public String getDeletedBy() {
		return deletedBy;
	}

	public void setDeletedBy(String deletedBy) {
		this.deletedBy = deletedBy;
	}
	
}