g

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FindByIDService

type FindByIDService[T any] struct{}

func (*FindByIDService[T]) FindByID

func (*FindByIDService[T]) FindByID(tx *gorm.DB, id string) (T, error)

type IBase

type IBase[T any, Q any] interface {
	PageList(Q) (*page.Data[T], error)
	Create(T) error
	Update(T) error
	Delete(int) error
}

type IBaseApi

type IBaseApi interface {
	PageList(ctx *gin.Context)
	Create(ctx *gin.Context)
	Update(ctx *gin.Context)
	Delete(ctx *gin.Context)
}

type UniqueService

type UniqueService[T any] struct{}

UniqueService 校验传入值是否已经在数据库中存在 T 表示要查询表的Model k为 'id' 作为排除,比如更新时

type UserService struct{
	g.Unique[model.User]
}

func (*UniqueService[T]) Verify

func (*UniqueService[T]) Verify(tx *gorm.DB, q map[string]any) error

Jump to

Keyboard shortcuts

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