generaliface

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DaoIface

type DaoIface[P int32 | int64 | string, 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)
	FindById(pkey P) (entity *E, found bool, err error)
	FindByIds(pks string) (*[]E, error)
	Query() *page.PageResult
	Count() (int, error)

	GetDB() *gorm.DB
}

type GoPkey

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

type IBaseModel

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

type IdIface

type IdIface[P any] interface {
	PkeyValue() P
}

type IdsIface

type IdsIface interface {
	GetIds() string
}

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