package com.reyun.model;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;

@Entity
public class Auth {

	private Long id;
	private Long roleCategory;
	private String controlAuth;
	private Long app;
	private Long account;
	private boolean retentionAuth;
	private boolean payAuth;
    private Long createAccount;
    private Date createTime;
    private Date modifyTime = new Date();
    private String modifyAccount;
    private Boolean status;
    private Boolean isNatureOpen;
    private Boolean campaign;
    private Boolean topAuth;

    //transient
    private List<RoleAuthDetail> roleAuthDetailList;
    private List<DataAuth> dataAuth;


	public Auth() {
		super();
	}

	public Auth(Long id, Long roleCategory, String controlAuth,
			Long app, Long account) {
		super();
		this.id = id;
		this.roleCategory = roleCategory;
		this.controlAuth = controlAuth;
		this.app = app;
		this.account = account;
	}

	@Id
	@GeneratedValue
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}


	public Long getRoleCategory() {
		return roleCategory;
	}

	public void setRoleCategory(Long roleCategory) {
		this.roleCategory = roleCategory;
	}

	public String getControlAuth() {
		return controlAuth;
	}

	public void setControlAuth(String controlAuth) {
		this.controlAuth = controlAuth;
	}

	public Long getApp() {
		return app;
	}

	public void setApp(Long app) {
		this.app = app;
	}

	public Long getAccount() {
		return account;
	}

	public void setAccount(Long account) {
		this.account = account;
	}

	public boolean isRetentionAuth() {
		return retentionAuth;
	}

	public void setRetentionAuth(boolean retentionAuth) {
		this.retentionAuth = retentionAuth;
	}

	public boolean isPayAuth() {
		return payAuth;
	}

	public void setPayAuth(boolean payAuth) {
		this.payAuth = payAuth;
	}

	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	public String getModifyAccount() {
		return modifyAccount;
	}

	public void setModifyAccount(String modifyAccount) {
		this.modifyAccount = modifyAccount;
	}

	public Boolean getStatus() {
		return status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

	public Boolean getIsNatureOpen() {
		return isNatureOpen;
	}

	public void setIsNatureOpen(Boolean isNatureOpen) {
		this.isNatureOpen = isNatureOpen;
	}

	public Boolean getCampaign() {
		return campaign;
	}

	public void setCampaign(Boolean campaign) {
		this.campaign = campaign;
	}

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Long getCreateAccount() {
        return createAccount;
    }

    public void setCreateAccount(Long createAccount) {
        this.createAccount = createAccount;
    }

    public Boolean getTopAuth() {
        return topAuth;
    }

    public void setTopAuth(Boolean topAuth) {
        this.topAuth = topAuth;
    }

    @Transient
    public List<RoleAuthDetail> getRoleAuthDetailList() {
        return roleAuthDetailList;
    }

    public void setRoleAuthDetailList(List<RoleAuthDetail> roleAuthDetailList) {
        this.roleAuthDetailList = roleAuthDetailList;
    }

    @Transient
    public List<DataAuth> getDataAuth() {
        return dataAuth;
    }

    public void setDataAuth(List<DataAuth> dataAuth) {
        this.dataAuth = dataAuth;
    }

    @Override
	public String toString() {
		return "Auth [id=" + id + ", roleCategory=" + roleCategory
				+ ", controlAuth=" + controlAuth + ", app=" + app
				+ ", account=" + account + ", retentionAuth=" + retentionAuth
				+ ", payAuth=" + payAuth + ", modifyTime=" + modifyTime
				+ ", modifyAccount=" + modifyAccount + ", status=" + status
				+ "]";
	}
	
	
}
