rest_gorm

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelToSnake

func CamelToSnake(s string) string

CamelToSnake преобразует строку из CamelCase в snake_case.

func Preload added in v1.19.0

func Preload(obj any, fields rest.FieldList, q *gorm.DB) (*gorm.DB, error)

Types

type List

type List struct {
	Conditions rest.ConditionList `json:"Conditions" swagger:"items=$ref:rest.Condition"`
	Orders     []*rest.Order      `json:"Orders" swagger:"items=$ref:rest.Order"`
	Offset     int                `json:"Offset"`
	Limit      int                `json:"Limit"`
}

func (*List) Prepare

func (s *List) Prepare()

func (*List) Result

func (s *List) Result(pg *gorm.DB, fields rest.FieldNamesList, res any) (count int64, err rest.IErrorArgs)

func (*List) ResultAnswer added in v1.18.0

func (s *List) ResultAnswer(pg *gorm.DB, fields rest.FieldNamesList, res any, offset, limit int) (*ResultList, rest.IErrorArgs)

func (*List) ResultOut added in v1.20.1

func (s *List) ResultOut(pg *gorm.DB, model any, req rest.IRequestIn) rest.IRequestOut

func (*List) ResultOutNames added in v1.20.2

func (s *List) ResultOutNames(pg *gorm.DB, fields rest.FieldNamesList, res any, req rest.IRequestIn) rest.IRequestOut

type ResultList added in v1.18.0

type ResultList struct {
	Items  []any `json:"Items" rest:"fixed"`
	Offset int   `json:"Offset" rest:"fixed"`
	Limit  int   `json:"Limit" rest:"fixed"`
	Count  int64 `json:"Count" rest:"fixed"`
}

func (*ResultList) Map added in v1.20.0

func (s *ResultList) Map(req rest.IRequestIn) (json.Map, rest.IErrorArgs)

func (*ResultList) Out added in v1.20.1

Jump to

Keyboard shortcuts

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