repository

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProductRepository

type ProductRepository interface {
	Create(product *models.Product) error
	GetByID(id uint) (*models.Product, error)
	Update(id uint, updates map[string]interface{}) error
	Delete(id uint) error
	List(query *models.ProductQuery) ([]*models.Product, int64, error)
}

ProductRepository 产品仓库接口

func NewProductRepository

func NewProductRepository(db *gorm.DB) ProductRepository

NewProductRepository 创建产品仓库

type UserRepository

type UserRepository interface {
	Create(user *models.User) error
	GetByID(id uint) (*models.User, error)
	GetByUsername(username string) (*models.User, error)
	GetByEmail(email string) (*models.User, error)
	Update(id uint, updates map[string]interface{}) error
	Delete(id uint) error
	List(offset, limit int) ([]*models.User, int64, error)
}

UserRepository 用户仓库接口

func NewUserRepository

func NewUserRepository(db *gorm.DB) UserRepository

NewUserRepository 创建用户仓库

Jump to

Keyboard shortcuts

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