package cn.reghao.bnt.web.admin.model.po;

import cn.reghao.bnt.web.util.BaseEntity;
import cn.reghao.jutil.jdk.web.log.AppLog;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;

/**
 * @author reghao
 * @date 2025-04-14 09:41:14
 */
@NoArgsConstructor
@Setter
@Getter
@Entity
@Table(name = "sys1_runtime_log")
public class RuntimeLog extends BaseEntity {
    private String requestId;
    private String app;
    private String host;
    private Long timestamp;
    private String level;
    private String thread;
    private String logger;
    @Column(columnDefinition="text")
    private String message;

    public RuntimeLog(AppLog appLog) {
        this.requestId = appLog.getRequestId();
        this.app = appLog.getApp();
        this.host = appLog.getHost();
        this.timestamp = appLog.getTimestamp();
        this.level = appLog.getLevel();
        this.thread = appLog.getThread();
        this.logger = appLog.getLogger();
        this.message = appLog.getMessage();
    }
}
