package com.yihu.jw.entity.iot.gateway;

import com.yihu.jw.entity.IntegerIdentityEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.sql.Timestamp;
import java.util.Date;

/**
 * GcHttpLog entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "gc_http_log")
@SequenceGenerator(name="id_generated", sequenceName="GC_HTTP_LOG_SQU")
public class GcHttpLog extends IntegerIdentityEntity implements java.io.Serializable {

    // Fields

    private String token;
    private String ip;
    private String method;
    private String input;
    private String output;
    private Date createTime;
    private Integer flag = 1;
    private String message;

    // Constructors

    /**
     * default constructor
     */
    public GcHttpLog() {
    }

    /**
     * full constructor
     */
    public GcHttpLog(String token, String ip, String method, String input,
                     String output, Timestamp createTime) {
        this.token = token;
        this.ip = ip;
        this.method = method;
        this.input = input;
        this.output = output;
        this.createTime = createTime;
    }


    @Column(name = "token")
    public String getToken() {
        return this.token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    @Column(name = "ip", length = 100)
    public String getIp() {
        return this.ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    @Column(name = "method")
    public String getMethod() {
        return this.method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    @Column(name = "input")
    public String getInput() {
        return this.input;
    }

    public void setInput(String input) {
        this.input = input;
    }

    @Column(name = "output")
    public String getOutput() {
        return this.output;
    }

    public void setOutput(String output) {
        this.output = output;
    }

    @Column(name = "create_time")

    public Date getCreateTime() {
        return this.createTime;
    }

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

    public Integer getFlag() {
        return flag;
    }

    public void setFlag(Integer flag) {
        this.flag = flag;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public enum flagEm {
        success(1),
        error(1)
        ;

        flagEm(Integer code) {
            this.code = code;
        }

        private Integer code;

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }
}