package com.lanyuanxiaoyao.service.configuration.entity.info;

import java.time.Instant;

/**
 * SQL
 *
 * @author lanyuanxiaoyao
 * @date 2023-07-11
 */
public class SQLLine {
    private String sql;
    private Long createTime;
    private String comment;

    public SQLLine() {
    }

    public SQLLine(String sql) {
        this(sql, "Unknown");
    }

    public SQLLine(String sql, String comment) {
        this.sql = sql;
        this.comment = comment;
        this.createTime = Instant.now().toEpochMilli();
    }

    public String getSql() {
        return sql;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public Long getCreateTime() {
        return createTime;
    }

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

    @Override
    public String toString() {
        return "SQLLine{" +
                "sql='" + sql + '\'' +
                ", createTime=" + createTime +
                ", comment='" + comment + '\'' +
                '}';
    }
}
