34 lines
1.3 KiB
Go
34 lines
1.3 KiB
Go
package main
|
|
|
|
import (
|
|
"time"
|
|
|
|
"91porn-server/generate/common"
|
|
|
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
)
|
|
|
|
type MediaBookshelf struct {
|
|
ID primitive.ObjectID `json:"id" bson:"_id,omitempty" comment:"文档id"`
|
|
Type int `json:"type" bson:"type" comment:"类型"`
|
|
Name string `json:"name" bson:"name" comment:"名称"`
|
|
MID primitive.ObjectID `json:"mid" bson:"mid" comment:"媒体ID"`
|
|
ReadHistory ReadHistory `json:"readHistory" bson:"readHistory" comment:"阅读记录"`
|
|
UID uint64 `json:"uid" bson:"uid" comment:"用户ID"`
|
|
IsDelete bool `json:"isDelete" bson:"isDelete" comment:"是否删除"`
|
|
ReadAt time.Time `json:"readAt" bson:"readAt" comment:"阅读时间"`
|
|
CreatedAt time.Time `json:"createdAt" bson:"createdAt" comment:"创建时间"`
|
|
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt" comment:"更新时间"`
|
|
}
|
|
|
|
type ReadHistory struct {
|
|
HasRead bool `json:"hasRead" bson:"hasRead"` // 是否已读
|
|
CID primitive.ObjectID `json:"cid" bson:"cid"` // 子集ID
|
|
Name string `json:"name" bson:"name"` // 续看子集名称
|
|
}
|
|
|
|
func main() {
|
|
g := common.NewGen("91porn-server", "媒体书架列表")
|
|
g.Generate(MediaBookshelf{})
|
|
}
|