package com.altimetrik.ee.demo.controller;

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.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

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



@RestController
@RequestMapping(value = "/stockQuote")
public class ServiceController {

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

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

	@Autowired
	private StockDetailsService detailsService;

	@GetMapping(value = "/queryQuote")
	public java.util.List<Stock> search(@RequestParam String symbols) {
		
		return detailsService.getStockQuotes(symbols);
	}

}
