Documentation ¶
Index ¶
- func InitTable(db *egorm.Component) error
- type Article
- type ArticleDao
- type ArticleGormDao
- func (dao *ArticleGormDao) Count(ctx context.Context, uid int64) (int64, error)
- func (dao *ArticleGormDao) Create(ctx context.Context, art Article) (int64, error)
- func (dao *ArticleGormDao) DeleteById(ctx context.Context, aid int64) error
- func (dao *ArticleGormDao) GetArtById(ctx context.Context, aid int64) (Article, error)
- func (dao *ArticleGormDao) GetPubArtById(ctx context.Context, aid int64) (PublishArticle, error)
- func (dao *ArticleGormDao) List(ctx context.Context, offset int, limit int, uid int64) ([]Article, error)
- func (dao *ArticleGormDao) PubList(ctx context.Context, offset int, limit int) ([]PublishArticle, error)
- func (dao *ArticleGormDao) PublishTotal(ctx context.Context) (int64, error)
- func (dao *ArticleGormDao) Sync(ctx context.Context, art Article) (int64, error)
- func (dao *ArticleGormDao) Update(ctx context.Context, art Article) error
- type PublishArticle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Article ¶
type Article struct { Id int64 `gorm:"primaryKey;autoIncrement"` // 对应作者 Uid int64 `gorm:"index"` Title string `gorm:"not null"` Content string `gorm:"type:text"` Abstract string `gorm:"type:text"` // 存储为毫秒时间戳 Ctime int64 `gorm:"autoCreateTime:milli"` // 自动创建时间,单位为毫秒 Utime int64 `gorm:"autoUpdateTime:milli;index"` // 自动更新时间,单位为毫秒 }
Article 制作库
type ArticleDao ¶
type ArticleDao interface { Create(ctx context.Context, art Article) (int64, error) Update(ctx context.Context, art Article) error Count(ctx context.Context, uid int64) (int64, error) List(ctx context.Context, offset int, limit int, uid int64) ([]Article, error) Sync(ctx context.Context, art Article) (int64, error) PublishTotal(ctx context.Context) (int64, error) PubList(ctx context.Context, offset int, limit int) ([]PublishArticle, error) GetArtById(ctx context.Context, aid int64) (Article, error) GetPubArtById(ctx context.Context, aid int64) (PublishArticle, error) DeleteById(ctx context.Context, aid int64) error }
func NewArticleGormDao ¶
func NewArticleGormDao(db *egorm.Component) ArticleDao
type ArticleGormDao ¶
type ArticleGormDao struct {
// contains filtered or unexported fields
}
func (*ArticleGormDao) DeleteById ¶
func (dao *ArticleGormDao) DeleteById(ctx context.Context, aid int64) error
func (*ArticleGormDao) GetArtById ¶
func (*ArticleGormDao) GetPubArtById ¶
func (dao *ArticleGormDao) GetPubArtById(ctx context.Context, aid int64) (PublishArticle, error)
func (*ArticleGormDao) PubList ¶
func (dao *ArticleGormDao) PubList(ctx context.Context, offset int, limit int) ([]PublishArticle, error)
func (*ArticleGormDao) PublishTotal ¶
func (dao *ArticleGormDao) PublishTotal(ctx context.Context) (int64, error)
type PublishArticle ¶
type PublishArticle Article
func (PublishArticle) TableName ¶
func (PublishArticle) TableName() string
Click to show internal directories.
Click to hide internal directories.