Documentation ¶
Index ¶
- Variables
- func BuildSpecification(db *gorm.DB, name string, criteria interface{}) (tx *gorm.DB)
- func CreateCommonOperationDb(db *gorm.DB, operation *CommonDbOperation) *gorm.DB
- func GinQuery2Criteria(queryParams map[string][]string, criteria interface{}) error
- func Map2Struct(dst, src interface{}) (err error)
- type BoolFilter
- type ClauseConstantsEnum
- type CommonDbOperation
- type FloatFilter
- type IntFilter
- type StringFilter
- type TimeFilter
Constants ¶
This section is empty.
Variables ¶
View Source
var ClauseConstants = ClauseConstantsEnum{
Regexp: "regexp",
Contains: "like",
Equals: "=",
NotEquals: "<>",
Lt: "<",
Lte: "<=",
Gt: ">",
Gte: ">=",
In: "in",
}
Functions ¶
func CreateCommonOperationDb ¶
func CreateCommonOperationDb(db *gorm.DB, operation *CommonDbOperation) *gorm.DB
*
- @Description: 封装其他操作
- @param db
- @param operation
- @return *gorm.DB
func Map2Struct ¶
func Map2Struct(dst, src interface{}) (err error)
*
- @Description: map转struct简易封装(适用于value为string类型)
- @param dst 自定义criteria
- @param src map
- @return err
Types ¶
type BoolFilter ¶
type BoolFilter struct {
Equals *bool
}
type ClauseConstantsEnum ¶
type ClauseConstantsEnum struct { Regexp string Contains string Equals string NotEquals string Lt string Lte string Gt string Gte string In string }
*
- @Description: 创建整数从句
- @param tx db操作
- @param name 查询参数名
- @param criteria 查询条件
type CommonDbOperation ¶
type FloatFilter ¶
type StringFilter ¶
Click to show internal directories.
Click to hide internal directories.