-
Notifications
You must be signed in to change notification settings - Fork 3
/
orm.go
53 lines (44 loc) · 897 Bytes
/
orm.go
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
package app
import "time"
type Pk struct {
// ID
Id int `orm:"pk;auto;column(id)"`
}
// Tenant
// 多租户
type Tenant struct {
Org int `orm:"column(org)"` // org为tenant标记
}
// TenantPk
// 不可与 Pk 同时使用
type TenantPk struct {
Pk
Tenant
}
type OperatorInfo struct {
CreateOperator int `orm:"column(coperator)"`
}
// OperatorChangeInfo
// 不可与 OperatorInfo 同时使用
type OperatorChangeInfo struct {
OperatorInfo
UpdateOperator int `orm:"column(moperator)"`
}
// TableChangeInfo
// 不可与 TableInfo 同时使用
type TableChangeInfo struct {
// 状态
Status int `orm:"column(status)"`
// 创建时间
TableInfo
// 修改时间
UpdateTime time.Time `orm:"auto_now;type(datetime);column(mtime)"`
}
type TableInfo struct {
// 创建时间
CreateTime time.Time `orm:"auto_now_add;type(datetime);column(ctime)"`
}
const (
Disable = iota
Enable
)