Documentation ¶
Index ¶
- func NewDb(config map[string]interface{}) (*gorm.DB, error)
- type Builder
- func (t *Builder) Field(field string) *Builder
- func (t *Builder) GetCountDb() *gorm.DB
- func (t *Builder) GetDb() *gorm.DB
- func (t *Builder) GetPageInfo(count int) (*paginate.PageInfo, int32)
- func (t *Builder) Order(order string) *Builder
- func (t *Builder) PaginateCursor(p *paginate.Pagination) *Builder
- func (t *Builder) PaginateOffSet(p *paginate.Pagination, needTotal bool) *Builder
- func (t *Builder) Prepare() *gorm.DB
- func (t *Builder) SetDb(db *gorm.DB)
- func (t *Builder) Where(where string, params map[string]string) *Builder
- type GormLog
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Builder ¶
type Builder struct { Pageinfo *paginate.PageInfo Total int32 // contains filtered or unexported fields }
配合gorm的查询构建器,方便做一个分页相关的处理,及数据库获取数据
func HandleListFetchRequest ¶
func HandleListFetchRequest(db *gorm.DB, ls interface{}, req *request.FetchRequest) (*Builder, error)
ls must be point to struct you can pass ls value like :
var data []fund.FundProd gormx.HandleListFetchRequest(app.Db,id,&data,req)
func HandleNodeRequest ¶
func HandleNodeRequest(db *gorm.DB, id interface{}, ls interface{}, req *request.NodeRequest) (*Builder, error)
ls must be point to struct you can pass ls value like :
data := &fund.FundProd{} gormx.HandleNodeRequest(app.Db,id,data,req)
func (*Builder) GetCountDb ¶
func (*Builder) PaginateCursor ¶
func (t *Builder) PaginateCursor(p *paginate.Pagination) *Builder
func (*Builder) PaginateOffSet ¶
func (t *Builder) PaginateOffSet(p *paginate.Pagination, needTotal bool) *Builder
type GormLog ¶
type GormLog struct {
// contains filtered or unexported fields
}
gorm zap GormLog
func CreateGormLog ¶
func CreateGormLog(values []interface{}) *GormLog
func (*GormLog) ToZapFields ¶
Click to show internal directories.
Click to hide internal directories.