gorm

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const BaseParamsStruct = "BaseValidationParams"
View Source
const PaginationParams = "Pagination"

Variables

This section is empty.

Functions

func MakeCondition

func MakeCondition[T any](params T) func(db *gorm.DB) *gorm.DB

func Paginate

func Paginate(pagination Pagination) func(db *gorm.DB) *gorm.DB

func TransWhere

func TransWhere(params any) string

TransWhere 结构体转换查询sql

Types

type Field

type Field struct {
	Name    string
	Field   string
	Where   string
	Default string
	Value   any
	Option  string
}

type Pagination

type Pagination struct {
	PageIndex int `form:"pageIndex"`
	PageSize  int `form:"pageSize"`
}

func (*Pagination) GetPageIndex

func (m *Pagination) GetPageIndex() int

func (*Pagination) GetPageSize

func (m *Pagination) GetPageSize() int

Jump to

Keyboard shortcuts

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