From 1cdf9c1408fc13df677e9f738e59fe46df86fc20 Mon Sep 17 00:00:00 2001
From: yanghui <yanghui@aiotlink.com>
Date: 星期二, 27 四月 2021 17:27:09 +0800
Subject: [PATCH] neate code
---
scheduleLog.go | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/scheduleLog.go b/scheduleLog.go
index 0cd045f..229c474 100644
--- a/scheduleLog.go
+++ b/scheduleLog.go
@@ -1,5 +1,7 @@
package logc
+import "encoding/json"
+
type ScheduleLog struct {
ID string `gorm:"column:id;primaryKey;unique;autoIncrement" json:"id"` // 涓婚敭id
Timestamp int64 `gorm:"column:timestamp" json:"timestamp"` // 鏃堕棿鎴砋nix time
@@ -9,3 +11,11 @@
Type int `gorm:"column:type" json:"type"` // 鎿嶄綔绫诲瀷:浜哄伐鎿嶄綔,鐧诲綍閫�鍑�,杞惊鎽勫儚鏈哄強瀵瑰簲绠楁硶,鏁版嵁鏍堝鐞嗘儏鍐�,寮傚父鎯呭喌绛�
Info string `gorm:"column:info" json:"info"` // 璇︽儏
}
+
+func (l * ScheduleLog)Marshal()([]byte, error) {
+ return json.Marshal(l)
+}
+
+func (l * ScheduleLog)Topic() string {
+ return ScheduleLogTopic
+}
--
Gitblit v1.8.0