haozhifeng
2021-08-12 fb66c0fd0f434ea46dfb2699525d5a59b019b457
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
28
29
package logc
 
import "encoding/json"
 
type RuleServerLog struct {
    ID           string `gorm:"column:id;primaryKey;unique;autoIncrement" json:"id"` // 主键id
    Name         string `gorm:"column:name" json:"name"`
    State        string `gorm:"column:state" json:"state"`
    TotalSuccess int    `gorm:"column:totalSuccess" json:"totalSuccess"`
    TotalFailure int    `gorm:"column:totalFailure" json:"totalFailure"`
    TotalCached  string `gorm:"column:totalCached" json:"totalCached"`
    LastSendDate string `gorm:"column:lastSendDate" json:"lastSendDate"`
    CreateDate   string  `gorm:"column:createDate" json:"createDate"`
}
 
type RuleServerPushLog struct {
    ID       string // 主键id
    TaskName string // 任务名称
    Type     int    // 消息类型: 0 更新状态 1 成功+1 2 失败+1 3 缓存上报
    Info     string // 详情
}
 
func (l *RuleServerPushLog) Marshal() ([]byte, error) {
    return json.Marshal(l)
}
 
func (l *RuleServerPushLog) Topic() string {
    return RuleServerLogTopic
}