1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package cn.flightfeather.supervision.common.log
 
import cn.flightfeather.supervision.common.utils.JsonUtil
import com.fasterxml.jackson.annotation.JsonFormat
import com.google.gson.Gson
import java.time.LocalDateTime
import java.util.*
 
/**
 * 日志信息结构
 * @date 2024/7/19
 * @author feiyu02
 */
open class AbstractLogInfo() {
 
    constructor(event: String) : this() {
        this.event = event
    }
 
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    var time: Date = Date()
    var event: String = ""
 
    fun toJsonStr(): String {
        return JsonUtil.gson.toJson(this)
    }
}