Documentation ¶
Index ¶
- Constants
- func InjectPageRequest(s *PageRequest)
- func InjectPageResult(s *PageResult)
- func LoadPageRequest() baseiface.ISingleton
- func LoadPageResult() baseiface.ISingleton
- func ParseLists[T any](result *PageResult) ([]T, error)
- type MultiWhereOr
- type NatsRequest
- type PageRequest
- func (self *PageRequest) Between(field string, opValues []interface{}) *PageRequest
- func (self *PageRequest) BuildWhere(dbc *gorm.DB) *gorm.DB
- func (self *PageRequest) BuildWhereLike(dbc *gorm.DB, field *dto.QueryField) *gorm.DB
- func (self *PageRequest) BuildWhereOrs(dbc *gorm.DB, ors []*MultiWhereOr) *gorm.DB
- func (self *PageRequest) CheckTyope(field string, value interface{})
- func (self *PageRequest) Clear()
- func (self *PageRequest) Count(model interface{}) (int, error)
- func (self *PageRequest) CountTable(table string) (int, error)
- func (self *PageRequest) CreateDynacStru(table string) reflect.Value
- func (self *PageRequest) Eq(field string, opValues interface{}) *PageRequest
- func (self *PageRequest) FindBy(model any, result interface{}) error
- func (self *PageRequest) FindById(model any, key int64) (bool, error)
- func (self *PageRequest) FindByTable(table string, result interface{}) error
- func (self *PageRequest) FindFieldSign(op int) base.FieldSign
- func (self *PageRequest) FindScanTable(table string) (*sql.Rows, error)
- func (self *PageRequest) FindTakeTable(table string, result interface{}) error
- func (self *PageRequest) Ge(field string, opValue interface{}) *PageRequest
- func (self *PageRequest) GetDB() *gorm.DB
- func (self *PageRequest) Gt(field string, opValue interface{}) *PageRequest
- func (self *PageRequest) IfCheckFilter(opValues any) bool
- func (self *PageRequest) IfExistsWhere() bool
- func (self *PageRequest) IfInt(opValues any) (bool, int)
- func (self *PageRequest) IfMultiLike(field *dto.QueryField) bool
- func (self *PageRequest) IfOrderBys() bool
- func (self *PageRequest) IfString(opValues any) (bool, string)
- func (self *PageRequest) In(field string, opValues []interface{}) *PageRequest
- func (self *PageRequest) InitPage()
- func (self *PageRequest) Insert(model interface{}) (any, error)
- func (self *PageRequest) Int64ArrToAny(arr []int64) []any
- func (self *PageRequest) IsNotNull(field string) *PageRequest
- func (self *PageRequest) IsNull(field string) *PageRequest
- func (self *PageRequest) Le(field string, opValue interface{}) *PageRequest
- func (self *PageRequest) Like(field string, opValue interface{}) *PageRequest
- func (self *PageRequest) Limit() int
- func (self *PageRequest) Lt(field string, opValue interface{}) *PageRequest
- func (self *PageRequest) NotBetween(field string, opValues []interface{}) *PageRequest
- func (self *PageRequest) NotIn(field string, opValues []interface{}) *PageRequest
- func (self *PageRequest) NotLike(field string, opValue interface{}) *PageRequest
- func (self *PageRequest) Order(dbc *gorm.DB) *gorm.DB
- func (self *PageRequest) OrderBy(field string, sort string) *PageRequest
- func (self *PageRequest) OrderByAsc(field string) *PageRequest
- func (self *PageRequest) OrderByAscScore(field string) *PageRequest
- func (self *PageRequest) OrderByAscSort(sortType string, field string) *PageRequest
- func (self *PageRequest) OrderByDesc(field string) *PageRequest
- func (self *PageRequest) OrderByDescScore(field string) *PageRequest
- func (self *PageRequest) OrderByDescSort(sortType string, field string) *PageRequest
- func (self *PageRequest) OrderBySortType(field string, sort string, sortType string) *PageRequest
- func (self *PageRequest) Query(model any, models interface{}) *PageResult
- func (self *PageRequest) QueryAll() bool
- func (self *PageRequest) QueryEmpty() bool
- func (self *PageRequest) QueryFields(f string, opType int, opValues []interface{}) *PageRequest
- func (self *PageRequest) QueryTable(table string, models interface{}) *PageResult
- func (self *PageRequest) QueryZero() bool
- func (self *PageRequest) ScanTable(table string, dbentity any) (any, error)
- func (self *PageRequest) SetLimit(dbc *gorm.DB) *gorm.DB
- func (self *PageRequest) SetPageCurrent(PageCurrent int) *PageRequest
- func (self *PageRequest) SetPageSize(PageSize int) *PageRequest
- func (self *PageRequest) SetQueryAll(queryAll bool)
- func (self *PageRequest) SetQueryEmpty(queryEmpty bool) *PageRequest
- func (self *PageRequest) SetQueryZero(queryZero bool) *PageRequest
- func (self *PageRequest) Start() int
- func (self *PageRequest) TakeTable(table string, model interface{}) *PageResult
- func (self *PageRequest) ToMap() (*map[string]interface{}, error)
- func (self *PageRequest) TransOpType(field *dto.QueryField)
- func (self *PageRequest) Update(model any, pkey int64) (any, error)
- func (self *PageRequest) Value2Like(v any) string
- type PageResult
- func DefaultResult() *PageResult
- func FindBeanPageResult() *PageResult
- func From(res *basedto.IchubResult) *PageResult
- func NewPage(code int, msg string) *PageResult
- func NewPageResultError(msg string) *PageResult
- func PageResultOf(req *PageRequest) *PageResult
- func ResultFailedPageResult(code int, msg string) *PageResult
- func ResultFailedPageResultErr(err error) *PageResult
- func ResultFailedPageResultMsg(msg string) *PageResult
- func ResultOk(data any) *PageResult
- func (self *PageResult) As(out interface{}) *PageResult
- func (self *PageResult) CodeMsg(Code int, Msg string) *PageResult
- func (self *PageResult) DataAsArrays() []map[string]interface{}
- func (self *PageResult) FailMsg(Msg string) *PageResult
- func (self *PageResult) FindMapVal(m any, key string) (any, bool)
- func (self *PageResult) GetMapVal(m any, key string) any
- func (self *PageResult) Init()
- func (self *PageResult) IsFailed() bool
- func (self *PageResult) IsSuccess() bool
- func (self *PageResult) OkMsg(Msg string) *PageResult
- func (self *PageResult) Ret2Bucket(aggKey string) map[string]any
- func (self *PageResult) Ret2Buckets(aggKey string) []any
- func (self *PageResult) Shutdown()
- func (self *PageResult) Success() *PageResult
- func (self *PageResult) To(out interface{})
- func (self *PageResult) WriteDaoFile(table string)
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)
var cfg *ichubconfig.IchubConfig
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
func ParseLists ¶
func ParseLists[T any](result *PageResult) ([]T, error)
Types ¶
type MultiWhereOr ¶
func NewMultiWhereOr ¶
func NewMultiWhereOr(fieldName string, value any) *MultiWhereOr
type NatsRequest ¶
type NatsRequest struct { }
func NewNatsRequest ¶
func NewNatsRequest() *NatsRequest
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 EsBoolType int `json:"es_bool_type"` //最后一个查询字段 LastQueryField *dto.QueryField `json:"-"` *baseconfig.DbClientDto `json:"-"` //cfg *ichubconfig.IchubConfig `json:"-"` database.FuncGetDb `json:"-"` // contains filtered or unexported fields }
func Default ¶
func Default() *PageRequest
func NewPageRequest ¶
func NewPageRequest(pageSize int, pageCurrent int) *PageRequest
func (*PageRequest) Between ¶
func (self *PageRequest) Between(field string, opValues []interface{}) *PageRequest
func (*PageRequest) BuildWhere ¶
func (self *PageRequest) BuildWhere(dbc *gorm.DB) *gorm.DB
func (*PageRequest) BuildWhereLike ¶
func (self *PageRequest) BuildWhereLike(dbc *gorm.DB, field *dto.QueryField) *gorm.DB
func (*PageRequest) BuildWhereOrs ¶
func (self *PageRequest) BuildWhereOrs(dbc *gorm.DB, ors []*MultiWhereOr) *gorm.DB
func (*PageRequest) CheckTyope ¶
func (self *PageRequest) CheckTyope(field string, value interface{})
func (*PageRequest) Clear ¶
func (self *PageRequest) Clear()
func (*PageRequest) Count ¶
func (self *PageRequest) Count(model interface{}) (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 interface{}) *PageRequest
func (*PageRequest) FindBy ¶
func (self *PageRequest) FindBy(model any, result interface{}) error
func (*PageRequest) FindById ¶
func (self *PageRequest) FindById(model any, key int64) (bool, error)
func (*PageRequest) FindByTable ¶
func (self *PageRequest) FindByTable(table string, result interface{}) error
func (*PageRequest) FindFieldSign ¶
func (self *PageRequest) FindFieldSign(op int) base.FieldSign
func (*PageRequest) FindScanTable ¶
func (self *PageRequest) FindScanTable(table string) (*sql.Rows, error)
func (*PageRequest) FindTakeTable ¶
func (self *PageRequest) FindTakeTable(table string, result interface{}) error
func (*PageRequest) Ge ¶
func (self *PageRequest) Ge(field string, opValue interface{}) *PageRequest
func (*PageRequest) GetDB ¶
func (self *PageRequest) GetDB() *gorm.DB
func (*PageRequest) Gt ¶
func (self *PageRequest) Gt(field string, opValue interface{}) *PageRequest
func (*PageRequest) IfCheckFilter ¶
func (self *PageRequest) IfCheckFilter(opValues any) bool
func (*PageRequest) IfExistsWhere ¶
func (self *PageRequest) IfExistsWhere() bool
func (*PageRequest) IfMultiLike ¶
func (self *PageRequest) IfMultiLike(field *dto.QueryField) bool
func (*PageRequest) IfOrderBys ¶
func (self *PageRequest) IfOrderBys() bool
func (*PageRequest) In ¶
func (self *PageRequest) In(field string, opValues []interface{}) *PageRequest
func (*PageRequest) InitPage ¶
func (self *PageRequest) InitPage()
func (*PageRequest) Insert ¶
func (self *PageRequest) Insert(model interface{}) (any, error)
func (*PageRequest) Int64ArrToAny ¶
func (self *PageRequest) Int64ArrToAny(arr []int64) []any
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 interface{}) *PageRequest
func (*PageRequest) Like ¶
func (self *PageRequest) Like(field string, opValue interface{}) *PageRequest
func (*PageRequest) Limit ¶
func (self *PageRequest) Limit() int
func (*PageRequest) Lt ¶
func (self *PageRequest) Lt(field string, opValue interface{}) *PageRequest
func (*PageRequest) NotBetween ¶
func (self *PageRequest) NotBetween(field string, opValues []interface{}) *PageRequest
func (*PageRequest) NotIn ¶
func (self *PageRequest) NotIn(field string, opValues []interface{}) *PageRequest
func (*PageRequest) NotLike ¶
func (self *PageRequest) NotLike(field string, opValue interface{}) *PageRequest
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 (self *PageRequest) OrderByAscScore(field string) *PageRequest
func (*PageRequest) OrderByAscSort ¶
func (self *PageRequest) OrderByAscSort(sortType string, field string) *PageRequest
func (*PageRequest) OrderByDesc ¶
func (self *PageRequest) OrderByDesc(field string) *PageRequest
func (*PageRequest) OrderByDescScore ¶
func (self *PageRequest) OrderByDescScore(field string) *PageRequest
func (*PageRequest) OrderByDescSort ¶
func (self *PageRequest) OrderByDescSort(sortType string, field string) *PageRequest
func (*PageRequest) OrderBySortType ¶
func (self *PageRequest) OrderBySortType(field string, sort string, sortType string) *PageRequest
func (*PageRequest) Query ¶
func (self *PageRequest) Query(model any, models interface{}) *PageResult
func (*PageRequest) QueryAll ¶
func (self *PageRequest) QueryAll() bool
func (*PageRequest) QueryEmpty ¶
func (self *PageRequest) QueryEmpty() bool
func (*PageRequest) QueryFields ¶
func (self *PageRequest) QueryFields(f string, opType int, opValues []interface{}) *PageRequest
func (*PageRequest) QueryTable ¶
func (self *PageRequest) QueryTable(table string, models interface{}) *PageResult
func (*PageRequest) QueryZero ¶
func (self *PageRequest) QueryZero() bool
func (*PageRequest) ScanTable ¶
func (self *PageRequest) ScanTable(table string, dbentity any) (any, error)
update
func (*PageRequest) SetPageCurrent ¶
func (self *PageRequest) SetPageCurrent(PageCurrent int) *PageRequest
func (*PageRequest) SetPageSize ¶
func (self *PageRequest) SetPageSize(PageSize int) *PageRequest
func (*PageRequest) SetQueryAll ¶
func (self *PageRequest) SetQueryAll(queryAll bool)
func (*PageRequest) SetQueryEmpty ¶
func (self *PageRequest) SetQueryEmpty(queryEmpty bool) *PageRequest
func (*PageRequest) SetQueryZero ¶
func (self *PageRequest) SetQueryZero(queryZero bool) *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) Value2Like ¶
func (self *PageRequest) Value2Like(v any) string
type PageResult ¶
type PageResult struct { basedto.IchubResult //总数 Total int `json:"total"` //每页记录 PageSize int `json:"page_size,omitempty"` //第几页 PageCurrent int `json:"current,omitempty"` Exist bool `json:"exist"` CmdName string `json:"cmd_name,omitempty"` CmdType esconst.CMDTYPE `json:"cmd_type,omitempty"` DataAgg any `json:"data_agg,omitempty"` DataAggs any `json:"data_aggs,omitempty"` DataHighlight any `json:"data_highlight,omitempty"` }
@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 From ¶
func From(res *basedto.IchubResult) *PageResult
func NewPage ¶
func NewPage(code int, msg string) *PageResult
func NewPageResultError ¶
func NewPageResultError(msg string) *PageResult
func PageResultOf ¶
func PageResultOf(req *PageRequest) *PageResult
func ResultFailedPageResult ¶
func ResultFailedPageResult(code int, msg string) *PageResult
func ResultFailedPageResultErr ¶
func ResultFailedPageResultErr(err error) *PageResult
func ResultFailedPageResultMsg ¶
func ResultFailedPageResultMsg(msg string) *PageResult
func ResultOk ¶
func ResultOk(data any) *PageResult
func (*PageResult) As ¶
func (self *PageResult) As(out interface{}) *PageResult
func (*PageResult) CodeMsg ¶
func (self *PageResult) CodeMsg(Code int, Msg string) *PageResult
func (*PageResult) DataAsArrays ¶
func (self *PageResult) DataAsArrays() []map[string]interface{}
func (*PageResult) FailMsg ¶
func (self *PageResult) FailMsg(Msg string) *PageResult
func (*PageResult) FindMapVal ¶
func (self *PageResult) FindMapVal(m any, key string) (any, bool)
func (*PageResult) Init ¶
func (self *PageResult) Init()
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) Ret2Bucket ¶
func (self *PageResult) Ret2Bucket(aggKey string) map[string]any
func (*PageResult) Ret2Buckets ¶
func (self *PageResult) Ret2Buckets(aggKey string) []any
func (*PageResult) Shutdown ¶
func (self *PageResult) Shutdown()
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)
Click to show internal directories.
Click to hide internal directories.