-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRedisMessage.go
More file actions
90 lines (84 loc) · 1.52 KB
/
RedisMessage.go
File metadata and controls
90 lines (84 loc) · 1.52 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package redisdkext
import (
"github.com/rolandhe/daog"
"github.com/rolandhe/daog/ttypes"
)
var RedisMessageFields = struct {
Id string
StreamKey string
MessageId string
ExpiredAt string
CreatedBy string
CreatedAt string
}{
"id",
"stream_key",
"message_id",
"expired_at",
"created_by",
"created_at",
}
var RedisMessageMeta = &daog.TableMeta[RedisMessage]{
Table: "redis_message",
Columns: []string{
"id",
"stream_key",
"message_id",
"expired_at",
"created_by",
"created_at",
},
AutoColumn: "id",
LookupFieldFunc: func(columnName string, ins *RedisMessage, point bool) any {
if "id" == columnName {
if point {
return &ins.Id
}
return ins.Id
}
if "stream_key" == columnName {
if point {
return &ins.StreamKey
}
return ins.StreamKey
}
if "message_id" == columnName {
if point {
return &ins.MessageId
}
return ins.MessageId
}
if "expired_at" == columnName {
if point {
return &ins.ExpiredAt
}
return ins.ExpiredAt
}
if "created_by" == columnName {
if point {
return &ins.CreatedBy
}
return ins.CreatedBy
}
if "created_at" == columnName {
if point {
return &ins.CreatedAt
}
return ins.CreatedAt
}
return nil
},
}
var RedisMessageDao daog.QuickDao[RedisMessage] = &struct {
daog.QuickDao[RedisMessage]
}{
daog.NewBaseQuickDao(RedisMessageMeta),
}
type RedisMessage struct {
Id int64
StreamKey string
MessageId string
ExpiredAt ttypes.NormalDatetime
CreatedBy int64
CreatedAt ttypes.NormalDatetime
}