Documentation ¶
Index ¶
- type Category4PostDraft
- type IPostDraftDao
- type PostDraft
- type PostDraftDao
- func (d *PostDraftDao) DeleteById(ctx context.Context, id string) (int64, error)
- func (d *PostDraftDao) GetById(ctx context.Context, id string) (*PostDraft, error)
- func (d *PostDraftDao) QueryPage(ctx context.Context, cond bson.D, findOptions *options.FindOptions) ([]*PostDraft, int64, error)
- func (d *PostDraftDao) Save(ctx context.Context, postDraft *PostDraft) (string, error)
- type Tag4PostDraft
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category4PostDraft ¶
type IPostDraftDao ¶
type IPostDraftDao interface { Save(ctx context.Context, postDraft *PostDraft) (string, error) GetById(ctx context.Context, id string) (*PostDraft, error) DeleteById(ctx context.Context, id string) (int64, error) QueryPage(ctx context.Context, cond bson.D, findOptions *options.FindOptions) ([]*PostDraft, int64, error) }
type PostDraft ¶
type PostDraft struct { ID string `bson:"_id"` CreatedAt time.Time `bson:"created_at,omitempty"` UpdatedAt time.Time `bson:"updated_at"` Author string `bson:"author"` Title string `bson:"title"` Summary string `bson:"summary"` Content string `bson:"content"` CoverImg string `bson:"cover_img"` Categories []Category4PostDraft `bson:"categories"` Tags []Tag4PostDraft `bson:"tags"` IsDisplayed bool `bson:"is_displayed"` StickyWeight int `bson:"sticky_weight"` MetaDescription string `bson:"meta_description"` MetaKeywords string `bson:"meta_keywords"` WordCount int `bson:"word_count"` IsCommentAllowed bool `bson:"is_comment_allowed"` }
func (*PostDraft) DefaultCreatedAt ¶
func (m *PostDraft) DefaultCreatedAt()
func (*PostDraft) DefaultUpdatedAt ¶
func (m *PostDraft) DefaultUpdatedAt()
type PostDraftDao ¶
type PostDraftDao struct {
// contains filtered or unexported fields
}
func NewPostDraftDao ¶
func NewPostDraftDao(db *mongo.Database) *PostDraftDao
func (*PostDraftDao) DeleteById ¶
type Tag4PostDraft ¶
Click to show internal directories.
Click to hide internal directories.