article

package
v0.0.0-...-2cadb06 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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"`
}

func (*Article) TableName

func (a *Article) TableName() string

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) Insert

func (dao *ArticleDaoImpl) Insert(ctx context.Context, article *Article) (int64, error)

func (*ArticleDaoImpl) List

func (dao *ArticleDaoImpl) List(ctx context.Context, offset int, limit int) ([]Article, error)

func (*ArticleDaoImpl) Sync

func (dao *ArticleDaoImpl) Sync(ctx context.Context, article Article) (int64, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL