package com.lightinit.hsdatagateway.common.persistence;

import com.lightinit.hsdatagateway.common.utils.IdWorker;
import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.Date;

/**
* Created by yangrui on2017/5/31.
 */
public abstract class DataVo<T> extends BaseVo<T> {

    /**
     * 创建者
     */
    protected Long createUser;

    /**
     * 创建日期
     */
    protected Date createTime;

    /**
     * 更新日期
     */
    protected Date updateTime;

    /**
     * 状态
     */
    protected Integer status;

    public DataVo(){

    }
    public DataVo(Long id){
        super();
        this.id = id;
    }

    public void nextId() throws Exception{
        this.id = IdWorker.getFlowIdWorkerInstance().nextId();
    }


    @JsonIgnore
    public Long getCreateUser() {
        return createUser;
    }

    public void setCreateUser(Long createUser) {
        this.createUser = createUser;
    }

    @JsonIgnore
    public Date getCreateTime() {
        return createTime;
    }

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

    @JsonIgnore
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getStatus() {
        return status;
    }

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