Documentation ¶
Index ¶
- type Article
- type ArticleDao
- type ArticleDaoImpl
- func (dao *ArticleDaoImpl) Insert(ctx context.Context, article *Article) (int64, error)
- func (dao *ArticleDaoImpl) List(ctx context.Context, offset int, limit int) ([]Article, error)
- func (dao *ArticleDaoImpl) Sync(ctx context.Context, article Article) (int64, error)
- func (dao *ArticleDaoImpl) Update(ctx context.Context, a *Article) error
- func (dao *ArticleDaoImpl) Upsert(ctx context.Context, article *PublishedArticle) error
- type PublishedArticle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { Id int64 `gorm:"primaryKey,autoIncrement" bson:"id,omitempty"` Title string `gorm:"type=varchar(1024)" bson:"title,omitempty"` Content string `gorm:"type=BLOB" bson:"content,omitempty"` AuthorId int64 `gorm:"index=aid_ctime" bson:"authorId,omitempty"` Status uint8 `bson:"status,omitempty"` CreateTime int64 `gorm:"index=aid_ctime" bson:"createTime,omitempty"` UpdateTime int64 `bson:"updateTime,omitempty"` }
type ArticleDao ¶
type ArticleDao interface { Insert(context.Context, *Article) (int64, error) Update(context.Context, *Article) error Sync(context.Context, Article) (int64, error) Upsert(context.Context, *PublishedArticle) error List(ctx context.Context, offset int, limit int) ([]Article, error) }
func NewArticleDao ¶
func NewArticleDao(db *gorm.DB, l *zap.Logger) ArticleDao
type ArticleDaoImpl ¶
type ArticleDaoImpl struct {
// contains filtered or unexported fields
}
func (*ArticleDaoImpl) Update ¶
func (dao *ArticleDaoImpl) Update(ctx context.Context, a *Article) error
func (*ArticleDaoImpl) Upsert ¶
func (dao *ArticleDaoImpl) Upsert(ctx context.Context, article *PublishedArticle) error
type PublishedArticle ¶
type PublishedArticle Article
PublishedArticle 发布文章
func (*PublishedArticle) TableName ¶
func (a *PublishedArticle) TableName() string
Click to show internal directories.
Click to hide internal directories.