Documentation
¶
Index ¶
- Variables
- func Create(db *gorm.DB, cud CUDFunc) (uint, error)
- func Delete(db *gorm.DB, cud CUDFunc, scopes ...func(db *gorm.DB) *gorm.DB) error
- func Find(db *gorm.DB, prf PageResponseFunc, scopes ...func(db *gorm.DB) *gorm.DB) error
- func First(db *gorm.DB, rf ResponseFunc, scopes ...func(db *gorm.DB) *gorm.DB) error
- func Pagination(db *gorm.DB, prf PageResponseFunc, pageScope func(db *gorm.DB) *gorm.DB, ...) (int64, error)
- func Update(db *gorm.DB, id uint, cud CUDFunc) error
- type CUDFunc
- type ErrMsg
- type Model
- type PageResponseFunc
- type Paginate
- type ReqId
- type Response
- type ResponseFunc
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type CUDFunc ¶
type CUDFunc interface { Create(db *gorm.DB) (uint, error) Update(db *gorm.DB, scopes ...func(db *gorm.DB) *gorm.DB) error Delete(db *gorm.DB, scopes ...func(db *gorm.DB) *gorm.DB) error }
CUDFunc 增改删接口
type Model ¶
type Model struct { Id uint `json:"id" uri:"id" form:"id" param:"id"` UpdatedAt string `json:"updatedAt" uri:"updatedAt" form:"updatedAt" param:"updatedAt"` CreatedAt string `json:"createdAt" uri:"createdAt" form:"createdAt" param:"createdAt"` DeletedAt string `json:"deletedAt" uri:"deletedAt" form:"deletedAt" param:"deletedAt"` }
Model
type PageResponseFunc ¶
type PageResponseFunc interface { Paginate(db *gorm.DB, pageScope func(db *gorm.DB) *gorm.DB, scopes ...func(db *gorm.DB) *gorm.DB) (int64, error) Find(db *gorm.DB, scopes ...func(db *gorm.DB) *gorm.DB) error }
PageResponseFunc 分页接口
type Paginate ¶
type Paginate struct { Page int `json:"page" form:"page"` PageSize int `json:"pageSize" form:"pageSize"` OrderBy string `json:"orderBy" form:"orderBy"` Sort string `json:"sort" form:"sort"` }
Paginate 验证请求参数
func (*Paginate) PaginateScope ¶
PaginateScope 分页 scope
Click to show internal directories.
Click to hide internal directories.