bizhelper

package
v1.3.0-sp7 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(raw *bool) bool

func BoolP

func BoolP(b bool) *bool

func CalcTags

func CalcTags(origin []string, op string, now []string) []string

func CalcTagsP

func CalcTagsP(origin []string, op *string, now []string) []string

func ExactExcludeQueryInt64Array added in v1.3.1

func ExactExcludeQueryInt64Array(db *gorm.DB, field string, s []int64) *gorm.DB

func ExactOrQueryArrayOr

func ExactOrQueryArrayOr(db *gorm.DB, field string, s []interface{}) *gorm.DB

func ExactOrQueryStringArrayOr

func ExactOrQueryStringArrayOr(db *gorm.DB, field string, s []string) *gorm.DB

func ExactQueryArrayOr

func ExactQueryArrayOr(db *gorm.DB, field string, s []interface{}) *gorm.DB

func ExactQueryExcludeArrayOr

func ExactQueryExcludeArrayOr(db *gorm.DB, field string, s []interface{}) *gorm.DB

func ExactQueryExcludeStringArrayOr

func ExactQueryExcludeStringArrayOr(db *gorm.DB, field string, s []string) *gorm.DB

func ExactQueryInt64

func ExactQueryInt64(db *gorm.DB, field string, value int64) *gorm.DB

func ExactQueryInt64ArrayOr

func ExactQueryInt64ArrayOr(db *gorm.DB, field string, s []int64) *gorm.DB

func ExactQueryInt64P

func ExactQueryInt64P(db *gorm.DB, field string, value *int64) *gorm.DB

func ExactQueryIntArrayOr

func ExactQueryIntArrayOr(db *gorm.DB, field string, s []int) *gorm.DB

func ExactQueryString

func ExactQueryString(db *gorm.DB, field string, value string) *gorm.DB

func ExactQueryStringArrayOr

func ExactQueryStringArrayOr(db *gorm.DB, field string, s []string) *gorm.DB

func ExactQueryStringP

func ExactQueryStringP(db *gorm.DB, field string, valueP *string) *gorm.DB

func Float64

func Float64(raw *float64) float64

func Float64P

func Float64P(i float64) *float64

func Float64PWithFixed

func Float64PWithFixed(i float64) *float64

func FuzzQuery

func FuzzQuery(db *gorm.DB, field string, value string) *gorm.DB

func FuzzQueryArrayOr

func FuzzQueryArrayOr(db *gorm.DB, field string, s []interface{}) *gorm.DB

func FuzzQueryArrayOrLike

func FuzzQueryArrayOrLike(db *gorm.DB, field string, s []interface{}) *gorm.DB

FuzzQueryArrayOrLike

func FuzzQueryArrayOrLikeExclude

func FuzzQueryArrayOrLikeExclude(db *gorm.DB, field string, s []interface{}) *gorm.DB

FuzzQueryArrayOrLike

func FuzzQueryArrayOrPrefixLike

func FuzzQueryArrayOrPrefixLike(db *gorm.DB, field string, s []interface{}) *gorm.DB

func FuzzQueryInt64ArrayOr

func FuzzQueryInt64ArrayOr(db *gorm.DB, field string, s []int64) *gorm.DB

func FuzzQueryIntArrayOr

func FuzzQueryIntArrayOr(db *gorm.DB, field string, s []int) *gorm.DB

func FuzzQueryJsonText

func FuzzQueryJsonText(db *gorm.DB, jsonField string, search string) *gorm.DB

func FuzzQueryJsonTextP

func FuzzQueryJsonTextP(db *gorm.DB, jsonField string, search *string) *gorm.DB

func FuzzQueryLike

func FuzzQueryLike(db *gorm.DB, field string, value string) *gorm.DB

func FuzzQueryP

func FuzzQueryP(db *gorm.DB, field string, valueP *string) *gorm.DB

func FuzzQueryPostgresStringArray

func FuzzQueryPostgresStringArray(
	db *gorm.DB,
	tableName string,
	subQueryField string,
	subQueryFieldArrayType string,
	data []string,
) *gorm.DB

func FuzzQueryPrefixLike

func FuzzQueryPrefixLike(db *gorm.DB, field string, value string) *gorm.DB

func FuzzQueryStrP

func FuzzQueryStrP(db *gorm.DB, field string, value *string) *gorm.DB

func FuzzQueryStringArrayOr

func FuzzQueryStringArrayOr(db *gorm.DB, field string, s []string) *gorm.DB

func FuzzQueryStringArrayOrLike

func FuzzQueryStringArrayOrLike(db *gorm.DB, field string, s []string) *gorm.DB

func FuzzQueryStringArrayOrLikeExclude

func FuzzQueryStringArrayOrLikeExclude(db *gorm.DB, field string, s []string) *gorm.DB

func FuzzQueryStringArrayOrPrefixLike

func FuzzQueryStringArrayOrPrefixLike(db *gorm.DB, field string, s []string) *gorm.DB

func FuzzQueryStringByFieldsOr

func FuzzQueryStringByFieldsOr(db *gorm.DB, fields []string, keyword string) *gorm.DB

func FuzzQueryStringByFieldsOrP

func FuzzQueryStringByFieldsOrP(db *gorm.DB, fields []string, keyword *string) *gorm.DB

func FuzzSearch

func FuzzSearch(db *gorm.DB, fields []string, target string) *gorm.DB

func FuzzSearchEx

func FuzzSearchEx(db *gorm.DB, fields []string, target string, ilike bool) *gorm.DB

func FuzzSearchP

func FuzzSearchP(db *gorm.DB, fields []string, target *string) *gorm.DB

func FuzzSearchWithStringArrayOr

func FuzzSearchWithStringArrayOr(db *gorm.DB, fields []string, targets []string) *gorm.DB

func FuzzSearchWithStringArrayOrAf

func FuzzSearchWithStringArrayOrAf(db *gorm.DB, fields []string, targets []string, ilike bool) *gorm.DB

func FuzzSearchWithStringArrayOrEx

func FuzzSearchWithStringArrayOrEx(db *gorm.DB, fields []string, targets []string, ilike bool) *gorm.DB

func GetFloat64ValueOr

func GetFloat64ValueOr(raw *float64, value float64) float64

func GetInt64ValueOr

func GetInt64ValueOr(raw *int64, value int64) int64

func GetStrValueOr

func GetStrValueOr(raw *string, value string) string

func Int

func Int(raw *int64) int

func Int64

func Int64(raw *int64) int64

func Int64P

func Int64P(i int64) *int64

func Int64P2Int

func Int64P2Int(raw *int64) int

func IntToInt64P

func IntToInt64P(i int) *int64

func OrFuzzQueryArrayOrLike

func OrFuzzQueryArrayOrLike(db *gorm.DB, field string, s []interface{}) *gorm.DB

func OrFuzzQueryStringArrayOrLike

func OrFuzzQueryStringArrayOrLike(db *gorm.DB, field string, s []string) *gorm.DB

func PrefixQueryString

func PrefixQueryString(db *gorm.DB, field string, value string) *gorm.DB

func PrefixQueryStringP

func PrefixQueryStringP(db *gorm.DB, field string, valueP *string) *gorm.DB

func QueryByBool

func QueryByBool(db *gorm.DB, field string, v bool) *gorm.DB

func QueryByBoolP

func QueryByBoolP(db *gorm.DB, byField string, v *bool) *gorm.DB

func QueryByJsonKey

func QueryByJsonKey(db *gorm.DB, field string, filter map[string]interface{}) *gorm.DB

func QueryByJsonKeyList

func QueryByJsonKeyList(db *gorm.DB, field string, keys *string, values *string, sep string) *gorm.DB

func QueryBySpecificAddress

func QueryBySpecificAddress(db *gorm.DB, field string, targets string) *gorm.DB

func QueryBySpecificAddressP

func QueryBySpecificAddressP(db *gorm.DB, field string, targets *string) *gorm.DB

func QueryBySpecificPorts

func QueryBySpecificPorts(db *gorm.DB, field string, ports string) *gorm.DB

func QueryByTimeRange

func QueryByTimeRange(db *gorm.DB, field string, start, end time.Time) *gorm.DB

func QueryByTimeRangeWithTimestamp

func QueryByTimeRangeWithTimestamp(db *gorm.DB, field string, startTs, endTs int64) *gorm.DB

func QueryByTimeRangeWithTimestampP

func QueryByTimeRangeWithTimestampP(db *gorm.DB, field string, startTs, endTs *int64) *gorm.DB

func QueryByTimestampRange

func QueryByTimestampRange(db *gorm.DB, field string, start, end int64) *gorm.DB

func QueryByTimestampRangeP

func QueryByTimestampRangeP(db *gorm.DB, field string, start, end *int64) *gorm.DB

func QueryCount

func QueryCount(db *gorm.DB, m interface{}, items *GormWhereBlock) int

func QueryDateTimeAfterTimestampOr

func QueryDateTimeAfterTimestampOr(db *gorm.DB, field string, timestamp int64) *gorm.DB

func QueryDateTimeBeforeTimestampOr

func QueryDateTimeBeforeTimestampOr(db *gorm.DB, field string, timestamp int64) *gorm.DB

func QueryIntegerInArrayInt64

func QueryIntegerInArrayInt64(db *gorm.DB, field string, targets []int64) *gorm.DB

func QueryLargerThanFloatOr_AboveZero

func QueryLargerThanFloatOr_AboveZero(db *gorm.DB, field string, value float64) *gorm.DB

func QueryLargerThanInt

func QueryLargerThanInt(db *gorm.DB, field string, value *int64) *gorm.DB

func QueryLargerThanIntOr_AboveZero

func QueryLargerThanIntOr_AboveZero(db *gorm.DB, field string, value int64) *gorm.DB

func QueryLessThanInt

func QueryLessThanInt(db *gorm.DB, field string, value *int64) *gorm.DB

func QueryOrder

func QueryOrder(db *gorm.DB, byField, order string) *gorm.DB

func QueryOrderP

func QueryOrderP(db *gorm.DB, orderBy, order *string) *gorm.DB

func QueryPostgresArrayCommonElements

func QueryPostgresArrayCommonElements(db *gorm.DB, field string, arrayType string, t []string) *gorm.DB

func QueryStringInStringSlice

func QueryStringInStringSlice(db *gorm.DB, field string, targets []string) *gorm.DB

func StartswithString

func StartswithString(db *gorm.DB, field string, value string) *gorm.DB

func StartswithStringArrayOr

func StartswithStringArrayOr(db *gorm.DB, field string, value []string) *gorm.DB

func StartswithStringLike

func StartswithStringLike(db *gorm.DB, field string, value string) *gorm.DB

func StartswithStringP

func StartswithStringP(db *gorm.DB, field string, valueP *string) *gorm.DB

func Str

func Str(raw *string) string

func StrEmptyOr

func StrEmptyOr(raw *string, value string) string

func StrP

func StrP(i string) *string

Types

type GormWhereBlock

type GormWhereBlock struct {
	Cond  string
	Items []interface{}
}

func MergeAndGormWhereBlocks

func MergeAndGormWhereBlocks(blocks []*GormWhereBlock) *GormWhereBlock

func MergeOrGormWhereBlocks

func MergeOrGormWhereBlocks(blocks []*GormWhereBlock) *GormWhereBlock

type Paginator

type Paginator struct {
	TotalRecord int         `json:"total_record"`
	TotalPage   int         `json:"total_page"`
	Records     interface{} `json:"records"`
	Offset      int         `json:"offset"`
	Limit       int         `json:"limit"`
	Page        int         `json:"page"`
	PrevPage    int         `json:"prev_page"`
	NextPage    int         `json:"next_page"`
}

Paginator 分页返回

func NewPagination

func NewPagination(p *Param, result interface{}) (*Paginator, *gorm.DB)

Paging 分页

func Paging

func Paging(db *gorm.DB, page int, limit int, data interface{}) (*Paginator, *gorm.DB)

func PagingByPagination added in v1.2.8

func PagingByPagination(db *gorm.DB, p *ypb.Paging, data any) (*Paginator, *gorm.DB)

func PagingP

func PagingP(db *gorm.DB, page *int64, limit *int64, data interface{}) (*Paginator, *gorm.DB)

type Param

type Param struct {
	DB      *gorm.DB
	Page    int
	Limit   int
	OrderBy []string
	ShowSQL bool
}

type Range added in v1.3.1

type Range struct {
	Min, Max int64
}

Jump to

Keyboard shortcuts

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