package com.javahonk.controller;

import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.javahonk.services.SpringJdbcDaoSupportService;

/**
 * @author javahonk
 *
 */
@Controller
@RequestMapping("service")
public class SpringJdbcDaoSupportController {
	
	@Autowired 
	SpringJdbcDaoSupportService springJdbDaoSupportService;
	
	private static final Logger logger = Logger.getLogger(SpringJdbcDaoSupportController.class);
	
	@RequestMapping(value = "/getPersonTable")
	public @ResponseBody List<Map<String, Object>> getPersonTable()  {		
		logger.debug("Entered List<Map<String, Object>> populateActivePSwapBasket()");
        return springJdbDaoSupportService.getPersonTable();
	}
	
	@RequestMapping(value = "/getPersonTableByName/{FirstName}")
	public @ResponseBody List<Map<String, Object>> getPersonTableByName(@PathVariable String FirstName)  {		
		logger.debug("Entered List<Map<String, Object>> populateActivePSwapBasket()");
        return springJdbDaoSupportService.getPersonTableByName(FirstName);
	}
	
}
