package com.altimetrik.ee.demo.service.impl;

import java.util.Arrays;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.altimetrik.ee.demo.entity.Stock;
import com.altimetrik.ee.demo.repository.StockDetailsRepository;
import com.altimetrik.ee.demo.service.StockDetailsService;

@Service
public class StockDetailsServiceImpl implements StockDetailsService {

	protected static Logger logger = LoggerFactory.getLogger(StockDetailsServiceImpl.class.getName());

	@Value("${spring.application.name}")
	private String applicationName;

	@Autowired
	private StockDetailsRepository detailsRepository;

	@Override
	public List<Stock> getStockQuotes(String quotesCSV) {
		
		return detailsRepository.findByStockQuoteIn(Arrays.asList(quotesCSV.split(",")));
		
	}

	

}
