package org.cs.mgr.user.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.cs.core.model.BaseEntity;

@Entity
@Table(name="app_sms")
public class SMS extends BaseEntity {

	/**
	 * 短信验证码存储
	 */
	private static final long serialVersionUID = -8505788510018561676L;

	private String phone;
	private int type;//1,注册获取验证码,2,忘记密码获取验证码
	private int validTime;
	private String code;

	private Integer id;
	


	@Id
	@SequenceGenerator(name="sequenceGenerator",sequenceName="SMS_SEQ")
	@GeneratedValue(generator="sequenceGenerator",strategy=GenerationType.SEQUENCE)
	@Column(name = "id", unique = true, nullable = false, precision = 11, scale = 0)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	@Column(name = "phone", columnDefinition="VARCHAR2(11) " )
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	@Column(name = "type", columnDefinition="NUMBER " )
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	
	@Column(name = "valid_time", columnDefinition="NUMBER " )
	public int getValidTime() {
		return validTime;
	}
	public void setValidTime(int validTime) {
		this.validTime = validTime;
	}
	
	@Column(name = "code", columnDefinition="VARCHAR2(6)")
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
}
