19 lines
667 B
Go
19 lines
667 B
Go
package bulletins_model
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type Bulletin struct {
|
|
ID uint `json:"id" gorm:"primaryKey"`
|
|
DateTime time.Time `json:"dateTime" gorm:"index"` // Time zone: Asia/Shanghai
|
|
Author string `json:"author" gorm:"type:varchar(20);index"`
|
|
Title string `json:"title"`
|
|
Content string `json:"content"`
|
|
// we use soft delete, to keep the uniqueness of ID
|
|
LastEditAt time.Time `json:"lastEditAt"` // Time zone: Asia/Shanghai
|
|
IsEdited bool `json:"isEdited" gorm:"default:false"`
|
|
IsDeleted bool `json:"isDeleted" gorm:"default:false"`
|
|
CreateAt time.Time `json:"createAt"` // Time zone: Asia/Shanghai
|
|
}
|