2022-09-27 17:59:05 +08:00
|
|
|
package entity
|
|
|
|
|
2022-11-30 19:11:28 +08:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
2022-09-27 17:59:05 +08:00
|
|
|
|
2022-11-21 16:51:13 +08:00
|
|
|
const (
|
2023-03-24 12:21:09 +08:00
|
|
|
// RevisioNnormalStatus this revision is Nnormal
|
|
|
|
RevisioNnormalStatus = 0
|
2022-11-21 16:51:13 +08:00
|
|
|
// RevisionUnreviewedStatus this revision is unreviewed
|
|
|
|
RevisionUnreviewedStatus = 1
|
|
|
|
// RevisionReviewPassStatus this revision is reviewed and approved by operator
|
|
|
|
RevisionReviewPassStatus = 2
|
|
|
|
// RevisionReviewRejectStatus this revision is reviewed and rejected by operator
|
|
|
|
RevisionReviewRejectStatus = 3
|
|
|
|
)
|
|
|
|
|
2022-09-27 17:59:05 +08:00
|
|
|
// Revision revision
|
|
|
|
type Revision struct {
|
2022-11-21 16:51:13 +08:00
|
|
|
ID string `xorm:"not null pk autoincr BIGINT(20) id"`
|
|
|
|
CreatedAt time.Time `xorm:"created TIMESTAMP created_at"`
|
|
|
|
UpdatedAt time.Time `xorm:"updated TIMESTAMP updated_at"`
|
|
|
|
UserID string `xorm:"not null default 0 BIGINT(20) user_id"`
|
2022-11-30 19:11:28 +08:00
|
|
|
ObjectType int `xorm:"not null default 0 INT(11) object_type"`
|
2022-11-21 16:51:13 +08:00
|
|
|
ObjectID string `xorm:"not null default 0 BIGINT(20) INDEX object_id"`
|
|
|
|
Title string `xorm:"not null default '' VARCHAR(255) title"`
|
|
|
|
Content string `xorm:"not null TEXT content"`
|
|
|
|
Log string `xorm:"VARCHAR(255) log"`
|
|
|
|
Status int `xorm:"not null default 1 INT(11) status"`
|
2022-11-22 19:48:27 +08:00
|
|
|
ReviewUserID int64 `xorm:"not null default 0 BIGINT(20) review_user_id"`
|
2022-09-27 17:59:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// TableName revision table name
|
|
|
|
func (Revision) TableName() string {
|
|
|
|
return "revision"
|
|
|
|
}
|