page

package
v1.0.1-dev-02 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MulanPSL-2.0 Imports: 24 Imported by: 16

Documentation

Index

Constants

View Source
const (
	SORT_TYPE_SCORE = "NewScoreSort"
)

@Title 文件名称: page_request.go @Description 描述: PageRequest

@Author 作者: leijianming@163.com 时间(2024-02-21 22:38:21) @Update 作者: leijianming@163.com 时间(2024-02-21 22:38:21)

Variables

This section is empty.

Functions

func InjectPageRequest

func InjectPageRequest(s *PageRequest)

func InjectPageResult

func InjectPageResult(s *PageResult)

func LoadPageRequest

func LoadPageRequest() baseiface.ISingleton

func LoadPageResult

func LoadPageResult() baseiface.ISingleton

Types

type PageRequest

type PageRequest struct {
	basedto.BaseEntity `json:"-"`
	RequestId          string `json:"request_id"`
	//每页记录数
	PageSize int `json:"page_size"`
	//当前页码
	PageCurrent int `json:"current"`
	//排序字段数组
	OrderBys []*dto.OrderByDto `json:"order_by"`
	//查询字段条件
	Fields                  []*dto.QueryField `json:"fields"`
	EsBoolType              int               `json:"es_bool_type"`
	IfSnake                 bool
	*baseconfig.DbClientDto `json:"-"`
}

func Default

func Default() *PageRequest

func FindBeanPageRequest

func FindBeanPageRequest() *PageRequest

func NewPageRequest

func NewPageRequest(pageSize int, pageCurrent int) *PageRequest

func (*PageRequest) Between

func (self *PageRequest) Between(field string, opValues []any) *PageRequest

func (*PageRequest) BuildOne

func (self *PageRequest) BuildOne(db *gorm.DB, field *dto.QueryField) *gorm.DB

func (*PageRequest) BuildWhere

func (self *PageRequest) BuildWhere(db *gorm.DB) *gorm.DB

func (*PageRequest) CheckType

func (self *PageRequest) CheckType(field string, value interface{})

func (*PageRequest) Clear

func (self *PageRequest) Clear()

func (*PageRequest) Count

func (self *PageRequest) Count(model any) (int, error)

func (*PageRequest) CountTable

func (self *PageRequest) CountTable(table string) (int, error)

func (*PageRequest) CreateDynacStru

func (self *PageRequest) CreateDynacStru(table string) reflect.Value

func (*PageRequest) Eq

func (self *PageRequest) Eq(field string, opValues any) *PageRequest

func (*PageRequest) FindBy

func (self *PageRequest) FindBy(model any, result any) error

func (*PageRequest) FindById

func (self *PageRequest) FindById(model any, key int64) (bool, error)

func (*PageRequest) FindByTable

func (self *PageRequest) FindByTable(table string, result any) error

func (*PageRequest) FindFieldSign

func (self *PageRequest) FindFieldSign(op int) base.FieldSign

func (*PageRequest) FindTakeTable

func (self *PageRequest) FindTakeTable(table string, result interface{}) error

func (*PageRequest) Ge

func (self *PageRequest) Ge(field string, opValue any) *PageRequest

func (*PageRequest) GetDB

func (self *PageRequest) GetDB() *gorm.DB

func (*PageRequest) Gt

func (self *PageRequest) Gt(field string, opValue any) *PageRequest

func (*PageRequest) IfExistsWhere

func (self *PageRequest) IfExistsWhere() bool

func (*PageRequest) IfOrderBys

func (self *PageRequest) IfOrderBys() bool

func (*PageRequest) In

func (self *PageRequest) In(field string, opValues []any) *PageRequest

func (*PageRequest) InitPage

func (self *PageRequest) InitPage()

func (*PageRequest) Insert

func (self *PageRequest) Insert(model any) (any, error)

func (*PageRequest) IsNotNull

func (self *PageRequest) IsNotNull(field string) *PageRequest

func (*PageRequest) IsNull

func (self *PageRequest) IsNull(field string) *PageRequest

func (*PageRequest) Le

func (self *PageRequest) Le(field string, opValue any) *PageRequest

func (*PageRequest) Like

func (self *PageRequest) Like(field string, opValue any) *PageRequest

func (*PageRequest) Limit

func (self *PageRequest) Limit() int

func (*PageRequest) Lt

func (self *PageRequest) Lt(field string, opValue any) *PageRequest

func (*PageRequest) NotBetween

func (self *PageRequest) NotBetween(field string, opValues []any) *PageRequest

func (*PageRequest) NotIn

func (self *PageRequest) NotIn(field string, opValues []any) *PageRequest

func (*PageRequest) NotLike

func (self *PageRequest) NotLike(field string, opValue any) *PageRequest

func (*PageRequest) Order

func (self *PageRequest) Order(dbc *gorm.DB) *gorm.DB

func (*PageRequest) OrderBy

func (self *PageRequest) OrderBy(field string, sort string) *PageRequest

func (*PageRequest) OrderByAsc

func (self *PageRequest) OrderByAsc(field string) *PageRequest

func (*PageRequest) OrderByAscScore

func (this *PageRequest) OrderByAscScore(field string) *PageRequest

func (*PageRequest) OrderByDesc

func (self *PageRequest) OrderByDesc(field string) *PageRequest

func (*PageRequest) OrderByDescSort

func (this *PageRequest) OrderByDescSort(sortType string, field string) *PageRequest

func (*PageRequest) OrderBySortType

func (this *PageRequest) OrderBySortType(field string, sort string, sortType string) *PageRequest

func (*PageRequest) Query

func (self *PageRequest) Query(entity any, entities any) *PageResult

func (*PageRequest) QueryFields

func (self *PageRequest) QueryFields(f string, opType int, opValues []interface{}) *PageRequest

func (*PageRequest) QueryTable

func (self *PageRequest) QueryTable(table string, models any) *PageResult

func (*PageRequest) SetLimit

func (self *PageRequest) SetLimit(dbc *gorm.DB) *gorm.DB

func (*PageRequest) SetPageCurrent

func (self *PageRequest) SetPageCurrent(current int) *PageRequest

func (*PageRequest) SetPageSize

func (self *PageRequest) SetPageSize(size int) *PageRequest

func (*PageRequest) Start

func (self *PageRequest) Start() int

func (*PageRequest) TakeTable

func (self *PageRequest) TakeTable(table string, model interface{}) *PageResult

func (*PageRequest) ToMap

func (self *PageRequest) ToMap() (*map[string]interface{}, error)

func (*PageRequest) TransOpType

func (self *PageRequest) TransOpType(field *dto.QueryField)

func (*PageRequest) Update

func (self *PageRequest) Update(model any, pkey int64) (any, error)

func (*PageRequest) WriteDaofile

func (self *PageRequest) WriteDaofile(model any, param any) error

type PageResult

type PageResult struct {
	basedto.BaseEntity

	Code int    `json:"code"`
	Msg  string `json:"msg"`

	PageSize    int `json:"page_size,omitempty"`
	PageCurrent int `json:"current,omitempty"`

	Total         int `json:"total,omitempty"`
	Data          any `json:"data"`
	DataAgg       any `json:"data_agg"`
	DataHighlight any `json:"data_highlight"`

	CmdType esconst.CMDTYPE `json:"cmd_type,omitempty"`
	CmdName string          `json:"cmd_name,omitempty"`
	Hosturl string          `json:"hosturl"`
}

@Title 文件名称: page_result.go @Description 描述: PageResult

@Author 作者: leijianming@163.com 时间(2024-02-21 22:38:21) @Update 作者: leijianming@163.com 时间(2024-02-21 22:38:21)

func DefaultResult

func DefaultResult() *PageResult

func FindBeanPageResult

func FindBeanPageResult() *PageResult

func NewIchubPageResult

func NewIchubPageResult() *PageResult

func NewPageResult

func NewPageResult(code int, msg string) *PageResult

func NewPageResultError

func NewPageResultError(msg string) *PageResult

func PageResultOf

func PageResultOf(req *PageRequest) *PageResult

func ResultFailMsg

func ResultFailMsg(Msg string) *PageResult

func ResultFailedPageResult

func ResultFailedPageResult(code int, msg string) *PageResult

func ResultFailedPageResultErr

func ResultFailedPageResultErr(err error) *PageResult

func ResultOk

func ResultOk(data any) *PageResult

func ResultSuccessData

func ResultSuccessData(data interface{}) *PageResult

func (*PageResult) CodeMsg

func (self *PageResult) CodeMsg(Code int, Msg string) *PageResult

func (*PageResult) FailMsg

func (self *PageResult) FailMsg(Msg string) *PageResult

func (*PageResult) IsFailed

func (self *PageResult) IsFailed() bool

func (*PageResult) IsSuccess

func (self *PageResult) IsSuccess() bool

func (*PageResult) OkMsg

func (self *PageResult) OkMsg(Msg string) *PageResult

func (*PageResult) ParseData

func (self *PageResult) ParseData(model interface{}) *PageResult

func (*PageResult) Result2Err

func (self *PageResult) Result2Err() error

func (*PageResult) Success

func (self *PageResult) Success() *PageResult

func (*PageResult) To

func (self *PageResult) To(out interface{})

func (*PageResult) WriteDaoFile

func (self *PageResult) WriteDaoFile(table string)

Jump to

Keyboard shortcuts

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