forked from ebhomengo/niki
1
0
Fork 0
niki/service/piggybankservice/service.go

22 lines
526 B
Go

package piggybankservice
import "git.gocasts.ir/ebhomengo/niki/entity"
type Repository interface {
AddPiggyBank(piggy entity.PiggyBank) (entity.PiggyBank, error)
EditPiggyBank(piggyID uint, piggyBankInput entity.PiggyBank) (entity.PiggyBank, error)
DeletePiggyBank(piggyID uint) error
GetAllPiggyBank() ([]entity.PiggyBank, error)
GetPiggyBankByID(piggyBank uint) (entity.PiggyBank, error)
}
type Service struct {
repo Repository
}
func New(repository Repository) Service {
return Service{
repo: repository,
}
}