package com.alterdekim.game.service;


import com.alterdekim.game.entity.Preloader;
import com.alterdekim.game.entity.PromotionBanner;
import com.alterdekim.game.repository.PreloaderRepository;
import com.alterdekim.game.repository.PromotionBannerRepository;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@AllArgsConstructor
@Service
public class PromotionBannerService {
    private final PromotionBannerRepository repository;

    public List<PromotionBanner> getSelected() {
        return repository.findSelected();
    }

    public List<PromotionBanner> getAll() {
        return repository.findAll();
    }

    public PromotionBanner getPromotionBannerById(long id) {
        return repository.findById(id).orElse(null);
    }

    public void removeById(long id) {
        repository.deleteById(id);
    }

    public void savePromotionBanner(PromotionBanner promotionBanner) {
        repository.save(promotionBanner);
    }
}
