Documentation ¶
Index ¶
- func NewDBEngine(databaseSetting *setting.DatabaseSettings) (*gorm.DB, error)
- type Article
- func (a Article) Count(db *gorm.DB) (int, error)
- func (a Article) Create(db *gorm.DB) error
- func (a Article) Delete(db *gorm.DB) error
- func (a Article) Get(db *gorm.DB) (*Article, error)
- func (a Article) List(db *gorm.DB, pageOffset, pageSize int) ([]*Article, error)
- func (a Article) TableName() string
- func (a Article) Update(db *gorm.DB, values interface{}) error
- type Auth
- type BlogArticleTag
- type Model
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDBEngine ¶
func NewDBEngine(databaseSetting *setting.DatabaseSettings) (*gorm.DB, error)
Types ¶
type Article ¶
type Article struct { *Model Title string `json:"title"` // 文章标题 Desc string `json:"desc"` // 文章简述 CoverImageUrl string `json:"cover_image_url"` // 封面图片地址 Content string `json:"content"` // 文章内容 State uint8 `json:"state"` // 状态:0为禁用、1为启用 }
type BlogArticleTag ¶
type BlogArticleTag struct { *Model ArticleId int32 `json:"article_id"` // 文章ID TagId int32 `json:"tag_id"` // 标签ID }
func (BlogArticleTag) TableName ¶
func (model BlogArticleTag) TableName() string
type Model ¶
type Model struct { ID uint32 `json:"id"` // id CreatedOn int32 `json:"created_on"` // 创建时间 CreatedBy string `json:"created_by"` // 创建人 ModifiedOn int32 `json:"modified_on"` // 修改时间 ModifiedBy string `json:"modified_by"` // 修改人 DeletedOn int32 `json:"deleted_on"` // 删除时间 IsDel int8 `json:"is_del"` // 是否删除 0为未删除、1为已删除 }
Click to show internal directories.
Click to hide internal directories.