package com.qxgmat.data.dao.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

@Table(name = "user_service")
public class UserService implements Serializable {
    @Id
    @Column(name = "`id`")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /**
     * 用户id
     */
    @Column(name = "`user_id`")
    private Integer userId;

    /**
     * 服务: vip, 
     */
    @Column(name = "`service`")
    private String service;

    @Column(name = "`start_time`")
    private Date startTime;

    @Column(name = "`expire_time`")
    private Date expireTime;

    private static final long serialVersionUID = 1L;

    /**
     * @return id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取用户id
     *
     * @return user_id - 用户id
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * 设置用户id
     *
     * @param userId 用户id
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 获取服务: vip, 
     *
     * @return service - 服务: vip, 
     */
    public String getService() {
        return service;
    }

    /**
     * 设置服务: vip, 
     *
     * @param service 服务: vip, 
     */
    public void setService(String service) {
        this.service = service;
    }

    /**
     * @return start_time
     */
    public Date getStartTime() {
        return startTime;
    }

    /**
     * @param startTime
     */
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    /**
     * @return expire_time
     */
    public Date getExpireTime() {
        return expireTime;
    }

    /**
     * @param expireTime
     */
    public void setExpireTime(Date expireTime) {
        this.expireTime = expireTime;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", service=").append(service);
        sb.append(", startTime=").append(startTime);
        sb.append(", expireTime=").append(expireTime);
        sb.append("]");
        return sb.toString();
    }

    public static UserService.Builder builder() {
        return new UserService.Builder();
    }

    public static class Builder {
        private UserService obj;

        public Builder() {
            this.obj = new UserService();
        }

        /**
         * @param id
         */
        public Builder id(Integer id) {
            obj.setId(id);
            return this;
        }

        /**
         * 设置用户id
         *
         * @param userId 用户id
         */
        public Builder userId(Integer userId) {
            obj.setUserId(userId);
            return this;
        }

        /**
         * 设置服务: vip, 
         *
         * @param service 服务: vip, 
         */
        public Builder service(String service) {
            obj.setService(service);
            return this;
        }

        /**
         * @param startTime
         */
        public Builder startTime(Date startTime) {
            obj.setStartTime(startTime);
            return this;
        }

        /**
         * @param expireTime
         */
        public Builder expireTime(Date expireTime) {
            obj.setExpireTime(expireTime);
            return this;
        }

        public UserService build() {
            return this.obj;
        }
    }
}