package com.bizzan.bitrade.service;

import com.bizzan.bitrade.dao.ExperienceGiftProductCoinRepository;
import com.bizzan.bitrade.entity.ExperienceGiftProductCoin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class ExperienceGiftProductCoinService {

    @Autowired
    private ExperienceGiftProductCoinRepository productCoinRepository;

    public Optional<ExperienceGiftProductCoin> findByProductIdAndCoinSymbol(Long productId, String coinSymbol) {
        return productCoinRepository.findByProductIdAndCoinSymbol(productId, coinSymbol);
    }

    public ExperienceGiftProductCoin save(ExperienceGiftProductCoin productCoin) {
        return productCoinRepository.save(productCoin);
    }
}
