repository

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDuplicated = errors.New("duplicated")
)

Functions

This section is empty.

Types

type PriceRepository

type PriceRepository interface {
	Create(ctx context.Context, userId uint, dateTime time.Time, store, product string, price uint, inStock bool) (*entity.Price, error)
	Find(ctx context.Context, id, userId uint) (*entity.Price, error)
	FindByUserId(ctx context.Context, userId uint) ([]entity.Price, error)
	Update(ctx context.Context, id, userId uint, dateTime time.Time, store, product string, price uint, inStock bool) (*entity.Price, int64, error)
	Delete(ctx context.Context, id, userId uint) (int64, error)
}

価格テーブル操作

func NewPriceRepository

func NewPriceRepository(db *gorm.DB) PriceRepository

type Repository

type Repository interface {
	InitDb(ctx context.Context) error

	BeginTx(ctx context.Context) (context.Context, error)
	Rollback(ctx context.Context) error
	Commit(ctx context.Context) error

	User() UserRepository
	Price() PriceRepository
}

func NewRepository

func NewRepository(sqlDB *sql.DB) (Repository, error)

type UserRepository

type UserRepository interface {
	Create(ctx context.Context, name, password string) (*entity.User, error)
	Find(ctx context.Context, name, password string) (*entity.User, error)
}

ユーザテーブル操作

func NewUserRepository

func NewUserRepository(db *gorm.DB) UserRepository

Jump to

Keyboard shortcuts

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