forked from ebhomengo/niki
22 lines
526 B
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,
|
|
}
|
|
}
|