gormx

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SumFieldsKey = "#sum"

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseCondition

type BaseCondition struct {
	Page     *int    `json:"page" form:"page"`         // zh: 页码
	Pagesize *int    `json:"pagesize" form:"pagesize"` // zh: 每页大小
	OrderKey *string `json:"orderKey" form:"orderKey"` // zh: 排序字段名
	Desc     *bool   `json:"desc" form:"desc"`         // zh: 是否降序
}

type MapResult added in v1.2.0

type MapResult struct {
	Total int64                    `json:"total"`
	List  []map[string]interface{} `json:"list"`
	Sum   map[string]interface{}   `json:"sum"`
}

type WrapDB

type WrapDB struct {
	Db *gorm.DB
	// contains filtered or unexported fields
}

func NewWrapDB

func NewWrapDB(db *gorm.DB, maxPagesize int, isAllowEmptyString bool) *WrapDB

func (*WrapDB) QueryWithMap

func (w *WrapDB) QueryWithMap(search map[string]interface{}) (r MapResult, err error)

func (*WrapDB) QueryWithStruct

func (w *WrapDB) QueryWithStruct(search interface{}, list interface{}, sum interface{}, total *int64) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL