pagedto

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MulanPSL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderAsc  = "asc"
	OrderDesc = "desc"
)

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

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

View Source
const (
	Eq = iota
	Ne
	Ge
	Gt
	Le
	Lt
	In
	Like
	Between
	NotIn
	NotLike
	NotBetween
)

Variables

View Source
var OpSign = map[int]FieldSign{
	Eq: "=",
	Ne: "!=",
	Ge: ">=",
	Gt: ">",
	Le: "<=",
	Lt: "<",

	In:         "in",
	Like:       "like",
	Between:    "between",
	NotIn:      "not in",
	NotLike:    "not like",
	NotBetween: "not between",
}

Functions

This section is empty.

Types

type FieldSign

type FieldSign string

type IchubPageRequest

type IchubPageRequest struct {
	basedto.BaseEntity `json:"-"`

	//每页记录数
	PageSize int `json:"page_size"`
	//当前页码
	PageCurrent int `json:"current"`
	//排序字段数组
	OrderBys []*pagebase.OrderByDto `json:"order_by"`
	//查询字段条件
	Fields []*pagebase.IchubQueryField `json:"fields"`
}

func NewIchubPageRequest

func NewIchubPageRequest() *IchubPageRequest

func NewPageRequest

func NewPageRequest(pageSize int, pageCurrent int) *IchubPageRequest

func (*IchubPageRequest) Between

func (this *IchubPageRequest) Between(field string, opValues []interface{}) *IchubPageRequest

func (*IchubPageRequest) BuildWhere

func (this *IchubPageRequest) BuildWhere(dbc *gorm.DB) *gorm.DB

func (*IchubPageRequest) CheckTyope

func (this *IchubPageRequest) CheckTyope(field string, value interface{})

func (*IchubPageRequest) Clear

func (this *IchubPageRequest) Clear()

func (*IchubPageRequest) Count

func (this *IchubPageRequest) Count(model interface{}) (int, error)

func (*IchubPageRequest) CountTable

func (this *IchubPageRequest) CountTable(table string) (int, error)

func (*IchubPageRequest) Eq

func (this *IchubPageRequest) Eq(field string, opValues interface{}) *IchubPageRequest

func (*IchubPageRequest) FindBy

func (this *IchubPageRequest) FindBy(model interface{}, result interface{}) error

func (*IchubPageRequest) FindById

func (this *IchubPageRequest) FindById(model interface{}, key int64) (bool, error)

func (*IchubPageRequest) FindByTable

func (this *IchubPageRequest) FindByTable(table string, result interface{}) error

func (*IchubPageRequest) FindFieldSign

func (this *IchubPageRequest) FindFieldSign(op int) pagebase.FieldSign

func (*IchubPageRequest) Ge

func (this *IchubPageRequest) Ge(field string, opValue interface{}) *IchubPageRequest

func (*IchubPageRequest) GetDB

func (this *IchubPageRequest) GetDB() *gorm.DB

func (*IchubPageRequest) Gt

func (this *IchubPageRequest) Gt(field string, opValue interface{}) *IchubPageRequest

func (*IchubPageRequest) In

func (this *IchubPageRequest) In(field string, opValues []interface{}) *IchubPageRequest

func (*IchubPageRequest) InitPage

func (this *IchubPageRequest) InitPage()

func (*IchubPageRequest) Insert

func (daoInst *IchubPageRequest) Insert(model interface{}) (interface{}, error)

func (*IchubPageRequest) Le

func (this *IchubPageRequest) Le(field string, opValue interface{}) *IchubPageRequest

func (*IchubPageRequest) Like

func (this *IchubPageRequest) Like(field string, opValue interface{}) *IchubPageRequest

func (*IchubPageRequest) Limit

func (this *IchubPageRequest) Limit() int

func (*IchubPageRequest) Lt

func (this *IchubPageRequest) Lt(field string, opValue interface{}) *IchubPageRequest

func (*IchubPageRequest) NotBetween

func (this *IchubPageRequest) NotBetween(field string, opValues []interface{}) *IchubPageRequest

func (*IchubPageRequest) NotIn

func (this *IchubPageRequest) NotIn(field string, opValues []interface{}) *IchubPageRequest

func (*IchubPageRequest) NotLike

func (this *IchubPageRequest) NotLike(field string, opValue interface{}) *IchubPageRequest

func (*IchubPageRequest) Order

func (this *IchubPageRequest) Order(dbc *gorm.DB) *gorm.DB

func (*IchubPageRequest) OrderBy

func (this *IchubPageRequest) OrderBy(field string, sort string) *IchubPageRequest

func (*IchubPageRequest) OrderByAsc added in v0.0.1

func (this *IchubPageRequest) OrderByAsc(field string) *IchubPageRequest

func (*IchubPageRequest) OrderByDesc added in v0.0.1

func (this *IchubPageRequest) OrderByDesc(field string) *IchubPageRequest

func (*IchubPageRequest) Query

func (this *IchubPageRequest) Query(model interface{}, models interface{}) *IchubPageResult

func (*IchubPageRequest) QueryFields

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

func (*IchubPageRequest) QueryTable

func (this *IchubPageRequest) QueryTable(table string, models interface{}) *IchubPageResult

func (*IchubPageRequest) SetLimit

func (this *IchubPageRequest) SetLimit(dbc *gorm.DB) *gorm.DB

func (*IchubPageRequest) Start

func (this *IchubPageRequest) Start() int

func (*IchubPageRequest) ToMap

func (this *IchubPageRequest) ToMap() (*map[string]interface{}, error)

func (*IchubPageRequest) Update

func (daoInst *IchubPageRequest) Update(model interface{}, pkey int64) (interface{}, error)

type IchubPageResult

type IchubPageResult struct {
	basedto.BaseEntity
	Code int    `json:"code"`
	Msg  string `json:"msg"`

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

	Total int         `json:"total"`
	Data  interface{} `json:"data,omitempty"`
}

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

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

func NewIchubPageResult

func NewIchubPageResult() *IchubPageResult

func NewPageResult

func NewPageResult(code int, msg string) *IchubPageResult

func NewPageResultError

func NewPageResultError(msg string) *IchubPageResult

func ValueOf

func ValueOf(req *IchubPageRequest) *IchubPageResult

func (*IchubPageResult) CodeMsg

func (this *IchubPageResult) CodeMsg(Code int, Msg string) *IchubPageResult

func (*IchubPageResult) FailMsg

func (this *IchubPageResult) FailMsg(Msg string) *IchubPageResult

func (*IchubPageResult) OkMsg

func (this *IchubPageResult) OkMsg(Msg string) *IchubPageResult

func (*IchubPageResult) Success

func (this *IchubPageResult) Success() *IchubPageResult

func (*IchubPageResult) To

func (this *IchubPageResult) To(out interface{})

type IchubQueryField

type IchubQueryField struct {
	basedto.BaseEntity
	Field string `json:"field"`

	OpType FieldSign     `json:"op_type"`
	Values []interface{} `json:"values"`
}

func NewFields

func NewFields(field string, opType int, opValues []interface{}) *IchubQueryField

func NewQueryFields

func NewQueryFields() *IchubQueryField

func (*IchubQueryField) CheckType

func (this *IchubQueryField) CheckType() string

func (*IchubQueryField) SetField

func (this *IchubQueryField) SetField(field string)

func (*IchubQueryField) Values2InStr

func (this *IchubQueryField) Values2InStr() string

type OrderByDto

type OrderByDto struct {
	Field string `json:"field"`
	Sort  string `json:"sort"` //desc  asc

}

func NewOrderByDto

func NewOrderByDto() *OrderByDto

func OrderBy

func OrderBy(field, sort string) *OrderByDto

func (*OrderByDto) SetField

func (this *OrderByDto) SetField(field string)

func (*OrderByDto) SetSort

func (this *OrderByDto) SetSort(sort string)

func (*OrderByDto) ToOrderBy

func (this *OrderByDto) ToOrderBy() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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