esreq

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MulanPSL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOfIndexObject

func NewOfIndexObject[T baseindex.IndexObject]() T

func NewOfIndexType

func NewOfIndexType[T baseindex.IndexMapping]() T

Types

type BaseRequest

type BaseRequest[T schema.Tabler] struct {
	EsWebClient *eswebclient.EsWebClient
	// contains filtered or unexported fields
}

func NewBaseRequest

func NewBaseRequest[T schema.Tabler]() *BaseRequest[T]

func (*BaseRequest[T]) Cms2QueryReq

func (self *BaseRequest[T]) Cms2QueryReq(indexTable baseindex.IndexTable, id string) *pagereq.QueryRequest

func (*BaseRequest[T]) Index

func (self *BaseRequest[T]) Index() baseindex.IndexMapping

func (*BaseRequest[T]) NewOfTablerType

func (self *BaseRequest[T]) NewOfTablerType() T

func (*BaseRequest[T]) SetIndex

func (self *BaseRequest[T]) SetIndex(index baseindex.IndexMapping)

type CmdRequest

type CmdRequest[T schema.Tabler] struct {
	*pagereq.CmdRequest
	*BaseRequest[T]
}

func DefaultCmd

func DefaultCmd[T schema.Tabler]() *CmdRequest[T]

func DefaultCmdAs

func DefaultCmdAs[T schema.Tabler](o T) *CmdRequest[T]

func (*CmdRequest[T]) BulkDelete

func (self *CmdRequest[T]) BulkDelete(ids ...any) *basedto.IchubResult

func (*CmdRequest[T]) BulkUpsert

func (self *CmdRequest[T]) BulkUpsert() *basedto.IchubResult

func (*CmdRequest[T]) CmsExistId

func (self *CmdRequest[T]) CmsExistId(id string) *page.PageResult

func (*CmdRequest[T]) Delete

func (self *CmdRequest[T]) Delete(id any) *basedto.IchubResult

func (*CmdRequest[T]) DeleteByQuery

func (self *CmdRequest[T]) DeleteByQuery() *basedto.IchubResult

func (*CmdRequest[T]) Save

func (self *CmdRequest[T]) Save(id any, doc map[string]any) *basedto.IchubResult

func (*CmdRequest[T]) SaveIndex

func (self *CmdRequest[T]) SaveIndex(index baseindex.IndexIface) *basedto.IchubResult

func (*CmdRequest[T]) SaveStru

func (self *CmdRequest[T]) SaveStru(id any, stru any) *basedto.IchubResult

func (*CmdRequest[T]) UpdataParam2Script

func (self *CmdRequest[T]) UpdataParam2Script(fieldAsParams map[string]interface{}) string

func (*CmdRequest[T]) Update

func (self *CmdRequest[T]) Update(ids any, doc map[string]any) *basedto.IchubResult

func (*CmdRequest[T]) Update2Err

func (self *CmdRequest[T]) Update2Err(id any, doc map[string]any) error

func (*CmdRequest[T]) UpdateByQuery

func (self *CmdRequest[T]) UpdateByQuery(updateClause string, fieldParams map[string]any) *basedto.IchubResult

func (*CmdRequest[T]) UpdateByQueryParam

func (self *CmdRequest[T]) UpdateByQueryParam(fieldAsParams map[string]any) *basedto.IchubResult

参数名=字段名

func (*CmdRequest[T]) UpdateIndex

func (self *CmdRequest[T]) UpdateIndex(doc baseindex.IndexIface) *basedto.IchubResult

func (*CmdRequest[T]) UpdateStru

func (self *CmdRequest[T]) UpdateStru(ids any, doc any) *basedto.IchubResult

func (*CmdRequest[T]) WebSaveIndex

func (self *CmdRequest[T]) WebSaveIndex(id any) *basedto.IchubResult

type MetaRequest

type MetaRequest[T baseindex.IndexMapping] struct {
	*pagereq.MetadataRequest
	*BaseRequest[T]
}

func DefaultMeta

func DefaultMeta[T baseindex.IndexMapping]() *MetaRequest[T]

func DefaultMetaAs

func DefaultMetaAs[T baseindex.IndexObject](o T) *MetaRequest[T]

func (*MetaRequest[T]) CreateIndexIfNotExist

func (self *MetaRequest[T]) CreateIndexIfNotExist() *basedto.IchubResult

func (*MetaRequest[T]) CreateIndexesIfNotExist

func (self *MetaRequest[T]) CreateIndexesIfNotExist() *basedto.IchubResult

func (*MetaRequest[T]) MetaCreateIndex

func (self *MetaRequest[T]) MetaCreateIndex() *basedto.IchubResult

func (*MetaRequest[T]) MetaDropIndex

func (self *MetaRequest[T]) MetaDropIndex() *basedto.IchubResult

func (*MetaRequest[T]) MetaGetMapping

func (self *MetaRequest[T]) MetaGetMapping() *basedto.IchubResult

func (*MetaRequest[T]) MetaIndexExists

func (self *MetaRequest[T]) MetaIndexExists() *basedto.IchubResult

type SysDept added in v1.2.6

type SysDept struct {
	//	SysDeptBase
	//	ModelBase
	basedto.BaseEntityIndex
	/*  部门id  */
	DeptId int64 `gorm:"column:dept_id;type:bigint(20);PRIMARY_KEY;comment:'部门id'" json:"dept_id,string"`
	/*  父部门id  */
	ParentId int64 `gorm:"column:parent_id;type:bigint(20);comment:'父部门id';default:0" json:"parent_id,string"`
	/*  祖级列表  */
	Ancestors string `gorm:"column:ancestors;type:varchar(50);comment:'祖级列表'" json:"ancestors"`
	/*  部门名称  */
	DeptName string `gorm:"column:dept_name;type:varchar(30);comment:'部门名称'" json:"dept_name"`
	/*  显示顺序  */
	OrderNum int32 `gorm:"column:order_num;type:int(4);comment:'显示顺序';default:0" json:"order_nm"`
	/*  负责人  */
	Leader string `gorm:"column:leader;type:varchar(20);comment:'负责人'" json:"leader"`
	/*  联系电话  */
	Phone string `gorm:"column:phone;type:varchar(11);comment:'联系电话'" json:"phone"`
	/*  邮箱  */
	Email string `gorm:"column:email;type:varchar(50);comment:'邮箱'" json:"email"`
	/*  部门状态(0正常 1停用)  */
	Status string `gorm:"column:status;type:char(1);comment:'部门状态(0正常 1停用)';default:\'0\'" json:"status"`
	/*  删除标志(0代表存在 2代表删除)  */
	DelFlag string `gorm:"column:del_flag;type:char(1);comment:'删除标志(0代表存在 2代表删除)';default:\'0\'" json:"del_flag"`
	/*  创建者  */
	CreateBy string `gorm:"column:create_by;type:varchar(64);comment:'创建者'" json:"create_by"`
	/*  创建时间  */
	CreateTime time.Time `gorm:"column:create_time;type:datetime;comment:'创建时间'" json:"create_time"`
	/*  更新者  */
	UpdateBy string `gorm:"column:update_by;type:varchar(64);comment:'更新者'" json:"update_by"`
	/*  更新时间  */
	UpdateTime time.Time `gorm:"column:update_time;type:datetime;comment:'更新时间'" json:"-"`
}

部门表

func (*SysDept) AutoMigrate added in v1.2.6

func (entity *SysDept) AutoMigrate(db *gorm.DB) error

迁移

func (*SysDept) GetAncestors added in v1.2.6

func (entity *SysDept) GetAncestors() string

func (*SysDept) GetCreateBy added in v1.2.6

func (entity *SysDept) GetCreateBy() string

func (*SysDept) GetCreateTime added in v1.2.6

func (entity *SysDept) GetCreateTime() basemodel.LocalTime

func (*SysDept) GetDelFlag added in v1.2.6

func (entity *SysDept) GetDelFlag() string

func (*SysDept) GetDeptId added in v1.2.6

func (entity *SysDept) GetDeptId() int64

func (*SysDept) GetDeptName added in v1.2.6

func (entity *SysDept) GetDeptName() string

func (*SysDept) GetEmail added in v1.2.6

func (entity *SysDept) GetEmail() string

func (*SysDept) GetLeader added in v1.2.6

func (entity *SysDept) GetLeader() string

func (*SysDept) GetOrderNum added in v1.2.6

func (entity *SysDept) GetOrderNum() int32

func (*SysDept) GetParentId added in v1.2.6

func (entity *SysDept) GetParentId() int64

func (*SysDept) GetPhone added in v1.2.6

func (entity *SysDept) GetPhone() string

func (*SysDept) GetStatus added in v1.2.6

func (entity *SysDept) GetStatus() string

func (*SysDept) GetUpdateBy added in v1.2.6

func (entity *SysDept) GetUpdateBy() string

func (*SysDept) GetUpdateTime added in v1.2.6

func (entity *SysDept) GetUpdateTime() time.Time

func (*SysDept) Ini added in v1.2.6

func (entity *SysDept) Ini(iniPk bool) *SysDept

iniPk bool:是否初始化主键DeptId 初始化指针

func (*SysDept) IniNil added in v1.2.6

func (entity *SysDept) IniNil(iniPk bool) *SysDept

iniPk bool:是否初始化主键DeptId 初始化指针

func (*SysDept) SetAncestors added in v1.2.6

func (entity *SysDept) SetAncestors(Ancestors string)

func (*SysDept) SetCreateBy added in v1.2.6

func (entity *SysDept) SetCreateBy(CreateBy string)

func (*SysDept) SetCreateTime added in v1.2.6

func (entity *SysDept) SetCreateTime(CreateTime basemodel.LocalTime)

func (*SysDept) SetDelFlag added in v1.2.6

func (entity *SysDept) SetDelFlag(DelFlag string)

func (*SysDept) SetDeptId added in v1.2.6

func (entity *SysDept) SetDeptId(DeptId int64)

func (*SysDept) SetDeptName added in v1.2.6

func (entity *SysDept) SetDeptName(DeptName string)

func (*SysDept) SetEmail added in v1.2.6

func (entity *SysDept) SetEmail(Email string)

func (*SysDept) SetLeader added in v1.2.6

func (entity *SysDept) SetLeader(Leader string)

func (*SysDept) SetOrderNum added in v1.2.6

func (entity *SysDept) SetOrderNum(OrderNum int32)

func (*SysDept) SetParentId added in v1.2.6

func (entity *SysDept) SetParentId(ParentId int64)

func (*SysDept) SetPhone added in v1.2.6

func (entity *SysDept) SetPhone(Phone string)

func (*SysDept) SetStatus added in v1.2.6

func (entity *SysDept) SetStatus(Status string)

func (*SysDept) SetUpdateBy added in v1.2.6

func (entity *SysDept) SetUpdateBy(UpdateBy string)

func (*SysDept) SetUpdateTime added in v1.2.6

func (entity *SysDept) SetUpdateTime(UpdateTime time.Time)

func (*SysDept) String added in v1.2.6

func (entity *SysDept) String() string

指定生成结果转json字符串

func (*SysDept) TableName added in v1.2.6

func (entity *SysDept) TableName() string

gorm默认生成的表名是结构名+'s',所以必须以结构方法指定!

func (*SysDept) ToString added in v1.2.6

func (entity *SysDept) ToString() string

func (*SysDept) Unmarshal added in v1.2.6

func (entity *SysDept) Unmarshal(body string) error

func (*SysDept) UnmarshalBy added in v1.2.6

func (entity *SysDept) UnmarshalBy(body []byte) error

type SysDeptVo added in v1.2.6

type SysDeptVo struct {

	/*  部门id  */
	DeptId int64 `gorm:"column:dept_id;type:bigint(20);PRIMARY_KEY;comment:'部门id'" json:"dept_id,string"`
	/*  父部门id  */
	ParentId int64 `gorm:"column:parent_id;type:bigint(20);comment:'父部门id';default:0" json:"parent_id,string"`
	/*  祖级列表  */
	Ancestors string `gorm:"column:ancestors;type:varchar(50);comment:'祖级列表'" json:"ancestors"`
	/*  部门名称  */
	DeptName string `gorm:"column:dept_name;type:varchar(30);comment:'部门名称'" json:"deptName"`
	/*  显示顺序  */
	OrderNum int32 `gorm:"column:order_num;type:int(4);comment:'显示顺序';default:0" json:"orderNum"`
	/*  负责人  */
	Leader string `gorm:"column:leader;type:varchar(20);comment:'负责人'" json:"leader"`
	/*  联系电话  */
	Phone string `gorm:"column:phone;type:varchar(11);comment:'联系电话'" json:"phone"`
	/*  邮箱  */
	Email string `gorm:"column:email;type:varchar(50);comment:'邮箱'" json:"email"`
	/*  部门状态(0正常 1停用)  */
	Status string `gorm:"column:status;type:char(1);comment:'部门状态(0正常 1停用)';default:\'0\'" json:"status"`
	/*  删除标志(0代表存在 2代表删除)  */
	DelFlag string `gorm:"column:del_flag;type:char(1);comment:'删除标志(0代表存在 2代表删除)';default:\'0\'" json:"delFlag"`
	/*  创建者  */
	CreateBy string `gorm:"column:create_by;type:varchar(64);comment:'创建者'" json:"createBy"`
	/*  创建时间  */
	CreateTime basemodel.LocalTime `gorm:"column:create_time;type:datetime;comment:'创建时间'" json:"createTime"`
	/*  更新者  */
	UpdateBy string `gorm:"column:update_by;type:varchar(64);comment:'更新者'" json:"updateBy"`
	/*  更新时间  */
	UpdateTime basemodel.LocalTime `gorm:"column:update_time;type:datetime;comment:'更新时间'" json:"updateTime"`
}

type WebRequest

type WebRequest[T schema.Tabler] struct {
	*BaseRequest[T]
	*pagereqcli.HttpCliQuery
	Records []T `json:"records"`
}

func Default

func Default[T schema.Tabler]() *WebRequest[T]

func DefaultAs

func DefaultAs[T schema.Tabler](o T) *WebRequest[T]

func DefaultOf

func DefaultOf[T schema.Tabler](generalQ elastic.Query) *WebRequest[T]

func (*WebRequest[T]) ExistId

func (self *WebRequest[T]) ExistId(id string) *pagemodel.PageResult[T]

func (*WebRequest[T]) FromPageResult

func (self *WebRequest[T]) FromPageResult(result *page.PageResult) *pagemodel.PageResult[T]

func (*WebRequest[T]) GeneralQuery

func (self *WebRequest[T]) GeneralQuery() *pagemodel.PageResult[T]

func (*WebRequest[T]) GeneralQueryMax

func (self *WebRequest[T]) GeneralQueryMax() *pagemodel.PageResult[T]

func (*WebRequest[T]) GeneralQueryMaxMax

func (self *WebRequest[T]) GeneralQueryMaxMax() *pagemodel.PageResult[T]

func (*WebRequest[T]) Get

func (self *WebRequest[T]) Get(ids any) *pagemodel.PageResult[T]

get

func (*WebRequest[T]) GetIndex

func (self *WebRequest[T]) GetIndex(indexTable baseindex.IndexTable, ids any) *pagemodel.PageResult[T]

func (*WebRequest[T]) Query

func (self *WebRequest[T]) Query(q elastic.Query) *WebRequest[T]

func (*WebRequest[T]) QueryResult

func (self *WebRequest[T]) QueryResult() *pagemodel.PageResult[T]

func (*WebRequest[T]) Result2List

func (self *WebRequest[T]) Result2List(result *page.PageResult) []T

func (*WebRequest[T]) Result2Tablers

func (self *WebRequest[T]) Result2Tablers(result *pagemodel.PageResult[T]) []schema.Tabler

func (*WebRequest[T]) SetModels

func (self *WebRequest[T]) SetModels(models any) *WebRequest[T]

func (*WebRequest[T]) Stru2Filter

func (self *WebRequest[T]) Stru2Filter(result *pagemodel.PageResult[T]) []any

Jump to

Keyboard shortcuts

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