26 lines
536 B
Go
26 lines
536 B
Go
package currencyService
|
|
|
|
import (
|
|
"git.ma-al.com/goc_daniel/b2b/app/model"
|
|
"git.ma-al.com/goc_daniel/b2b/app/repos/currencyRepo"
|
|
)
|
|
|
|
type CurrencyService struct {
|
|
repo currencyRepo.UICurrencyRepo
|
|
}
|
|
|
|
func (s *CurrencyService) GetCurrency(id uint) (*model.Currency, error) {
|
|
return s.repo.Get(id)
|
|
}
|
|
|
|
func (s *CurrencyService) CreateCurrencyRate(currency *model.CurrencyRate) error {
|
|
return s.repo.CreateConversionRate(currency)
|
|
}
|
|
|
|
func New() *CurrencyService {
|
|
repo := currencyRepo.New()
|
|
return &CurrencyService{
|
|
repo: repo,
|
|
}
|
|
}
|