generaliface

package
v0.0.0-...-0b700f4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbcheckIface

type DbcheckIface[P GoPkey, E IBaseModel[P]] interface {
	CacheListAll() *pagemodel.PageResult[E]
	CacheListKeyOf(v any) *pagemodel.IchubResult[E]
	CacheListAllOf(f string, v any) *pagemodel.IchubResult[E]
	CacheFindId(v any) *pagemodel.IchubResult[E]
	CheckRecord(pkeyValue P, exps string) *basedto.IchubResult
}

type GeneralDaoIface

type GeneralDaoIface[P GoPkey, E IBaseModel[P]] interface {
	Insert(entity E) (P, error)
	DeleteById(pkey P) error
	Save(entity E) (P, error)
	Update(entity E) (P, error)
	UpdateNotNull(pkey P, maps map[string]any) (P, error)
	UpdateMap(pkey P, maps map[string]interface{}) (P, error)

	GeneralDaoQueryIface[P, E]
}

type GeneralDaoQueryIface

type GeneralDaoQueryIface[P GoPkey, E IBaseModel[P]] interface {
	FindById(pkey P) (entity E, found bool, err error)
	FindByIds(pks string) (*[]E, error)
	Query() *page.PageResult
	QueryModel() *pagemodel.PageResult[E]
	QueryPageui() *pageui.PageuiResult
	QueryPageuiModel() *pageuimodel.PageuiResult[E]
	Count() (int, error)

	GetDB() *gorm.DB
}

type GoPkey

type GoPkey interface {
	~int | ~int32 | ~int64 | ~string | ~uint32 | ~uint64 | ~uint
}

type GodbPkey

type GodbPkey interface {
	~int32 | ~int64 | ~string
}

type IBaseDao

type IBaseDao[P GoPkey, E IBaseModel[P]] interface {
	DeleteByIdResult(pkey P) *pagemodel.IchubResult[P]
	DeleteById(pkey P) error
	DeleteWhere() error
	Save(entity E) (P, error)
	Insert(entity E) (P, error)
	UpdateColumns(entity E) (P, error)
	UpdateColumnsZero(entity E) (P, error)
	UpdateColumn(entity E) (P, error)
	Updates(entity E) (P, error)
	Update(entity E) (P, error)
	UpdateNotNull(pkeyValue P, maps map[string]interface{}) (P, error)
	UpdateMap(pkey P, maps map[string]interface{}) (P, error)
	UpdateMap2Result(pkey P, maps map[string]interface{}) *basedto.IchubResult
	FindById(pkey P) (E, bool, error)
	FindByIdExist(pkey P) (E, bool, error)
	FindByIdNotExist(pkey P) (E, bool, error)
	FindByIdResult(pkey P) *pagemodel.IchubResult[E]
	FindByIds(pkstr string) (*[]E, error)
	QueryModelAll() *pagemodel.PageResult[E]
	QueryModelMax() *pagemodel.PageResult[E]
	QueryModelMaxMax() *pagemodel.PageResult[E]
	QueryModel(pageSize ...int) *pagemodel.PageResult[E]
	QueryModelEmpty(pageSize ...int) *pagemodel.PageResult[E]
	QueryModelNotEmpty(pageSize ...int) *pagemodel.PageResult[E]
	List(pageSize ...int) *pagemodel.PageResult[E]
	QueryPageui() *pageui.PageuiResult
	QueryUi() *pageui.PageuiResult
	QueryPageuiModel() *pageuimodel.PageuiResult[E]
	Query(pageSize ...int) *page.PageResult
	Count() (int, error)
	GetDB() *gorm.DB
	DefaultGetDB() *gorm.DB
	DbCheckRecord(pvalue P, exps string) *basedto.IchubResult
	IndexObjectAll() string
	IndexObjectKey(id any) string
	CacheListAll() *pagemodel.PageResult[E]
	IfEq(a any, b any) bool
	GetStruField(some any, field string) any
	CacheListKeyOf(v any) *pagemodel.IchubResult[E]
	CacheListAllOf(fieldName string, v any) *pagemodel.IchubResult[E]
	CacheFindId(v any) *pagemodel.IchubResult[E]
	CheckRecord(pvalue P, exps string) *basedto.IchubResult
	CheckRecordRet(ret *pagemodel.IchubResult[E], exps string) *basedto.IchubResult
	IsRecordNotFound(err error) bool
	Save2ResultNotZero(entity E) *basedto.IchubResult
	Save2Result(entity E) *basedto.IchubResult
	Save2ResultZero(entity E) *basedto.IchubResult
	SaveZero(entity E) (P, error)
	InitFuncGetDb(dbKey string)
}

type IBaseEsModel

type IBaseEsModel[P GoPkey] interface {
	TableName() string
	GetMapping() string
}

type IBaseModel

type IBaseModel[P GoPkey] interface {
	PkeyName() string
	PkeyValue() P
	TableName() string
	Fill()
}

type IdbEntity

type IdbEntity[P GodbPkey] interface {
	PkeyName() string
	PkeyValue() P
	TableName() string
}

type ServiceIface

type ServiceIface interface {
	Query(param *page.PageRequest) *page.PageResult
	Count(param *page.PageRequest) (int, error)

	FindById(SubsysId int32) *basedto.IchubResult
	FindByIds(pks string) *page.PageResult
	DeleteById(Id int32) *basedto.IchubResult
	//Save(entity any) *basedto.IchubResult
	UpdateNotNull(Id int32, entity map[string]interface{}) *basedto.IchubResult
}

type WebIface

type WebIface interface {
	Query(ctx *gin.Context)
	FindById(ctx *gin.Context)
	DeleteById(ctx *gin.Context)
	Save(ctx *gin.Context)
	UpdateNotNull(ctx *gin.Context)
}

Jump to

Keyboard shortcuts

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