Documentation
¶
Index ¶
- func GetCategoryDB(db *gorm.DB) *gorm.DB
- func GetContentDB(db *gorm.DB) *gorm.DB
- type Category
- func (m *Category) BatchDelete(db *gorm.DB, ids []int) error
- func (m *Category) Create(db *gorm.DB, item Category) error
- func (m *Category) Delete(db *gorm.DB, id int) error
- func (m *Category) Get(db *gorm.DB) (*Category, error)
- func (m *Category) Query(db *gorm.DB, params param.CategoryParam) (*pagination.Result, error)
- func (m *Category) Update(db *gorm.DB, item Category) error
- type Content
- func (m *Content) BatchDelete(db *gorm.DB, ids []int) error
- func (m *Content) Create(db *gorm.DB, item Content) error
- func (m *Content) Delete(db *gorm.DB, id int) error
- func (m *Content) Get(db *gorm.DB) (*Content, error)
- func (m *Content) Query(db *gorm.DB, params param.ContentParam) (*pagination.Result, error)
- func (m *Content) Update(db *gorm.DB, item Content) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Category ¶
type Category struct { ID uint `json:"id" gorm:"primaryKey;"` // 分类ID Name string `json:"name" gorm:"type:varchar(255);"` // 名称 Img string `json:"img" gorm:"type:varchar(255);"` // 图片 Sort string `json:"sort" gorm:"type:int(4);"` // 排序 Status string `json:"status" gorm:"type:int(1);"` // 状态 Remark string `json:"remark" gorm:"type:varchar(255);"` // 备注 CreateBy string `json:"createBy" gorm:"type:varchar(64);"` // 创建者 UpdateBy string `json:"updateBy" gorm:"type:varchar(64);"` // 更新者 models.AtModel DataScope string `json:"dataScope" gorm:"-"` Params string `json:"params" gorm:"-"` }
Category 分类实体
func (*Category) BatchDelete ¶
BatchDelete 批量删除
func (*Category) Query ¶
func (m *Category) Query(db *gorm.DB, params param.CategoryParam) (*pagination.Result, error)
Query 查询数据
type Content ¶
type Content struct { ID uint `json:"id" gorm:"primary_key;"` // id CateID string `json:"cateId" gorm:"type:int(11);"` // 分类id Name string `json:"name" gorm:"type:varchar(255);"` // 名称 Status string `json:"status" gorm:"type:int(1);"` // 状态 Img string `json:"img" gorm:"type:varchar(255);"` // 图片 Content string `json:"content" gorm:"type:text;"` // 内容 Remark string `json:"remark" gorm:"type:varchar(255);"` // 备注 Sort string `json:"sort" gorm:"type:int(4);"` // 排序 CreateBy string `json:"createBy" gorm:"type:varchar(128);"` // 创建者 UpdateBy string `json:"updateBy" gorm:"type:varchar(128);"` // 更新者 DataScope string `json:"dataScope" gorm:"-"` Params string `json:"params" gorm:"-"` models.AtModel }
Content 内容实体
func (*Content) BatchDelete ¶
BatchDelete 批量删除
func (*Content) Query ¶
func (m *Content) Query(db *gorm.DB, params param.ContentParam) (*pagination.Result, error)
Query 查询数据
Click to show internal directories.
Click to hide internal directories.