package userio.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 DataAuth {

	private Long id;
	private Long account;
	private Long app;
	private Long campaign;
	private String campaignCode;
	private Long channel;
    private Boolean allCampaign;
    private Date modifyTime = new Date();
    private String modifyAccount;
    private Boolean delFlag;
	private Boolean channelPermit;//子账号渠道权限是否放开
    //Transient
    private List<Long> campaignList;

	public DataAuth() {
		super();
	}

	public DataAuth(Long id, Long app, Long campaign, String campaignCode,
                    Long channel, Boolean allCampaign, Boolean channelPermit) {
		super();
		this.id = id;
		this.app = app;
		this.campaign = campaign;
		this.campaignCode = campaignCode;
		this.channel = channel;
        this.allCampaign = allCampaign;
        this.channelPermit = channelPermit;
	}

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

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

	public Long getApp() {
		return app;
	}

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

	public Long getCampaign() {
		return campaign;
	}

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

	public String getCampaignCode() {
		return campaignCode;
	}

	public void setCampaignCode(String campaignCode) {
		this.campaignCode = campaignCode;
	}

	public Long getChannel() {
		return channel;
	}

	public void setChannel(Long channel) {
		this.channel = channel;
	}

	public Long getAccount() {
		return account;
	}

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

	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 getAllCampaign() {
        return allCampaign;
    }

    public void setAllCampaign(Boolean allCampaign) {
        this.allCampaign = allCampaign;
    }

    public Boolean getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(Boolean delFlag) {
        this.delFlag = delFlag;
    }

	public Boolean getChannelPermit() {
		return channelPermit;
	}

	public void setChannelPermit(Boolean channelPermit) {
		this.channelPermit = channelPermit;
	}

	@Transient
    public List<Long> getCampaignList() {
        return campaignList;
    }

    public void setCampaignList(List<Long> campaignList) {
        this.campaignList = campaignList;
    }
}
