Documentation ¶
Index ¶
- func NewDBEngine(databaseConfig *config.DatabaseConfig) (*gorm.DB, error)
- type Article
- type Category
- type Tag
- type User
- func (u User) Create(db *gorm.DB) error
- func (u User) Delete(db *gorm.DB) (int64, error)
- func (u User) GetByEmail(db *gorm.DB) (User, error)
- func (u User) GetById(db *gorm.DB, id uint) (User, error)
- func (u User) List(db *gorm.DB, pageOffset, pageSize int) ([]User, error)
- func (u User) Update(db *gorm.DB) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Article ¶
type Article struct { gorm.Model Title string `gorm:"type:varchar(60);not null;comment:标题"` Description string `gorm:"type:varchar(600);not null;comment:摘要"` Content string `gorm:"type:text;not null;comment:内容"` AuthorId int `gorm:"type:int(10);unsigned;not null;comment:作者 ID"` Author string `gorm:"type:varchar(20);not null;comment:作者"` CategoryId int `gorm:"type:tinyint(3);not null;comment:分类 ID"` CategoryName string `gorm:"type:varchar(20);not null;comment:分类名称"` TagId int `gorm:"type:int(10);unsigned;not null;comment:标签 ID"` TagName string `gorm:"type:varchar(20);not null;comment:标签名称"` }
Click to show internal directories.
Click to hide internal directories.