33 lines
800 B
Go
33 lines
800 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) SaveSetting(ctx context.Context, key, value string) (domain.Setting, error) {
|
|
return s.settingStore.SaveSetting(ctx, key, value)
|
|
}
|