/
document_history.go
39 lines (34 loc) · 1.26 KB
/
document_history.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
package mysql
import (
"time"
)
type DocumentHistory struct {
HistoryId int `gorm:"not null;primary_key;AUTO_INCREMENT"json:"historyId"`
Action string `gorm:"not null;"json:"action"`
ActionName string `gorm:"not null;"json:"actionName"`
DocumentId int `gorm:"not null;"json:"documentId"`
DocumentName string `gorm:"not null;"json:"documentName"`
ParentId int `gorm:"not null;"json:"parentId"`
MemberId int `gorm:"not null;"json:"memberId"`
ModifyTime time.Time `gorm:"not null;"json:"modifyTime"`
ModifyAt int `gorm:"not null;"json:"modifyAt"`
Version int64 `gorm:"not null;"json:"version"`
}
type DocumentHistorySimpleResult struct {
HistoryId int `json:"history_id"`
ActionName string `json:"action_name"`
MemberId int `json:"member_id"`
Account string `json:"account"`
Nickname string `json:"nickname"`
ModifyAt int `json:"modify_at"`
ModifyName string `json:"modify_name"`
ModifyTime time.Time `json:"modify_time"`
Version int64 `json:"version"`
}
// TableName 获取对应数据库表名.
func (m DocumentHistory) TableName() string {
return "document_history"
}
func NewDocumentHistory() *DocumentHistory {
return &DocumentHistory{}
}