utils

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrDuplicateKey = "Error 1062"
)

Variables

This section is empty.

Functions

func GetFields

func GetFields(ctx *gin.Context) []string

func GetInt64Param

func GetInt64Param(ctx *gin.Context, param string) (int64, error)

func GetIntParam

func GetIntParam(ctx *gin.Context, param string) (int, error)

func GetLimit

func GetLimit(ctx *gin.Context) int

func GetOffset

func GetOffset(ctx *gin.Context) int

func GetOrder

func GetOrder(ctx *gin.Context) []string

func GetPKName

func GetPKName(i interface{}) (pkName, pkJson string, err error)

func GetQuery

func GetQuery(ctx *gin.Context) (map[string]string, error)

func GetStringParam

func GetStringParam(ctx *gin.Context, param string) string

Types

type ModelInfo

type ModelInfo struct {
	Model  reflect.Type
	Models reflect.Type
	PKName string
	PKJson string
}

func NewModelInfo added in v1.0.1

func NewModelInfo(model interface{}, pkName, pkJson string) *ModelInfo

func (*ModelInfo) GetModel

func (m *ModelInfo) GetModel() reflect.Value

func (*ModelInfo) GetModels

func (m *ModelInfo) GetModels() reflect.Value

type QueryConditions

type QueryConditions struct {
	Query  map[string]string
	Fields []string
	Order  []string
	Limit  int
	Offset int
}

func ParseQueryCond

func ParseQueryCond(ctx *gin.Context) (QueryConditions, error)

Jump to

Keyboard shortcuts

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