usecase

package
v0.0.0-...-4b66723 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

README

/internal/usecase

This directory contains use case modules responsible for defining application specific business rules.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type City

type City struct {
	Log        *zap.Logger
	DB         *gorm.DB
	Repository repository.City[int, []int]
}

func NewCity

func NewCity(log *zap.Logger, db *gorm.DB, repository *repository.City[int, []int]) *City

func (*City) GetById

func (uc *City) GetById(ctx context.Context, request model.GetCityByIDRequest[[]int]) (*[]entity.City, int64, error)

func (*City) GetFirstById

func (uc *City) GetFirstById(ctx context.Context, request model.GetCityByIDRequest[int]) (*entity.City, int64, error)

func (*City) List

func (uc *City) List(ctx context.Context, request model.ListCityByIDRequest[[]int]) (*[]entity.City, int64, error)

type District

type District struct {
	Log        *zap.Logger
	DB         *gorm.DB
	Repository repository.District[int, []int]
}

func NewDistrict

func NewDistrict(log *zap.Logger, db *gorm.DB, repository *repository.District[int, []int]) *District

func (*District) GetById

func (uc *District) GetById(ctx context.Context, request model.GetDistrictByIDRequest[[]int]) (*[]entity.District, int64, error)

func (*District) GetFirstById

func (uc *District) GetFirstById(ctx context.Context, request model.GetDistrictByIDRequest[int]) (*entity.District, int64, error)

func (*District) List

type Village

type Village struct {
	Log        *zap.Logger
	DB         *gorm.DB
	Repository repository.Village[int, []int]
}

func NewVillage

func NewVillage(log *zap.Logger, db *gorm.DB, repository *repository.Village[int, []int]) *Village

func (*Village) GetById

func (uc *Village) GetById(ctx context.Context, request model.GetVillageByIDRequest[[]int]) (*[]entity.Village, int64, error)

func (*Village) GetFirstById

func (uc *Village) GetFirstById(ctx context.Context, request model.GetVillageByIDRequest[int]) (*entity.Village, int64, error)

func (*Village) List

func (uc *Village) List(ctx context.Context, request model.ListVillageByIDRequest[[]int]) (*[]entity.Village, int64, error)

Jump to

Keyboard shortcuts

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