37 lines
950 B
Go
37 lines
950 B
Go
package settings
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/SamuelTariku/FortuneBet-Backend/internal/domain"
|
|
)
|
|
|
|
type Service struct {
|
|
settingStore SettingStore
|
|
}
|
|
|
|
func NewService(settingStore SettingStore) *Service {
|
|
return &Service{
|
|
settingStore: settingStore,
|
|
}
|
|
}
|
|
|
|
func (s *Service) GetSettingList(ctx context.Context) (domain.SettingList, error) {
|
|
return s.settingStore.GetSettingList(ctx)
|
|
}
|
|
|
|
func (s *Service) GetSettings(ctx context.Context) ([]domain.Setting, error) {
|
|
return s.settingStore.GetSettings(ctx)
|
|
}
|
|
|
|
func (s *Service) GetSetting(ctx context.Context, key string) (domain.Setting, error) {
|
|
return s.settingStore.GetSetting(ctx, key)
|
|
}
|
|
func (s *Service) UpdateSetting(ctx context.Context, key, value string) error {
|
|
return s.settingStore.UpdateSetting(ctx, key, value)
|
|
}
|
|
|
|
func (s *Service) UpdateSettingList(ctx context.Context, settingList domain.ValidSettingList) error {
|
|
return s.settingStore.UpdateSettingList(ctx, settingList)
|
|
}
|