usecase

package
v0.0.0-...-49a09ed Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateUserInputDto

type CreateUserInputDto struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

type CreateUserOutputDto

type CreateUserOutputDto struct {
	ID    uint   `json:"id"`
	Name  string `json:"name"`
	Email string `json:"email"`
}

type CreateUserUseCase

type CreateUserUseCase struct {
	UserRepository entity.UserRepository
}

func NewCreateUserUseCase

func NewCreateUserUseCase(UserRepository entity.UserRepository) *CreateUserUseCase

func (*CreateUserUseCase) Execute

type DeleteUserInputDto

type DeleteUserInputDto struct {
	ID uint `json:"id"`
}

type DeleteUserOutputDto

type DeleteUserOutputDto struct {
	ID uint `json:"id"`
}

type DeleteUserUseCase

type DeleteUserUseCase struct {
	UserRepository entity.UserRepository
}

func NewDeleteUserUseCase

func NewDeleteUserUseCase(UserRepository entity.UserRepository) *DeleteUserUseCase

func (*DeleteUserUseCase) Execute

type GetAllUsersOutputDto

type GetAllUsersOutputDto struct {
	Users []*entity.User `json:"users"`
}

type GetAllUsersUseCase

type GetAllUsersUseCase struct {
	UserRepository entity.UserRepository
}

func NewGetAllUsersUseCase

func NewGetAllUsersUseCase(UserRepository entity.UserRepository) *GetAllUsersUseCase

func (*GetAllUsersUseCase) Execute

type GetUserByIDInputDto

type GetUserByIDInputDto struct {
	ID uint `json:"id"`
}

type GetUserByIDOutputDto

type GetUserByIDOutputDto struct {
	ID    uint   `json:"id"`
	Name  string `json:"name"`
	Email string `json:"email"`
}

type GetUserByIDUseCase

type GetUserByIDUseCase struct {
	UserRepository entity.UserRepository
}

func NewGetUserByIDUseCase

func NewGetUserByIDUseCase(UserRepository entity.UserRepository) *GetUserByIDUseCase

func (*GetUserByIDUseCase) Execute

type PromotionUseCase

type PromotionUseCase struct {
	// contains filtered or unexported fields
}

func NewPromotionUseCase

func NewPromotionUseCase(repo entity.PromotionRepository) *PromotionUseCase

func (*PromotionUseCase) ApplyPromotion

func (uc *PromotionUseCase) ApplyPromotion(promoID uint, userIDs []int) error

func (*PromotionUseCase) GetAppliedUsers

func (uc *PromotionUseCase) GetAppliedUsers(promoID uint) ([]int, error)

func (*PromotionUseCase) GetAvailableUsers

func (uc *PromotionUseCase) GetAvailableUsers(promoType int) ([]int, error)

type UpdateUserInputDto

type UpdateUserInputDto struct {
	ID    uint   `json:"id"`
	Name  string `json:"name"`
	Email string `json:"email"`
}

type UpdateUserOutputDto

type UpdateUserOutputDto struct {
	ID    uint   `json:"id"`
	Name  string `json:"name"`
	Email string `json:"email"`
}

type UpdateUserUseCase

type UpdateUserUseCase struct {
	UserRepository entity.UserRepository
}

func NewUpdateUserUseCase

func NewUpdateUserUseCase(UserRepository entity.UserRepository) *UpdateUserUseCase

func (*UpdateUserUseCase) Execute

Jump to

Keyboard shortcuts

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