package com.cku.controller;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSONObject;
import com.cku.util.*;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.cku.core.PageBeanResult;
import com.cku.core.RESTResponse;
import com.cku.model.CkuImage;
import com.cku.model.ShowVenue;
import com.cku.service.CkuImageServiceImpl;
import com.cku.service.ShowVenueServiceImpl;

@Controller
@RequestMapping(value="showVenue")
public class ShowVenueController {
	private static final Logger logger = Logger.getLogger(ShowVenueController.class);
	@Autowired
	public ShowVenueServiceImpl showVenueSerivce;

	//得到所有接口
	@RequestMapping(value="/getVenue")
	@ResponseBody//结果不会被解析为跳转路径，而是直接写入HTTP response body中
	public void getVenue(@RequestParam(value = "showLocation", required = false)String showLocation,
			HttpServletResponse response,HttpServletRequest request) {
		try {
			//showLocation =new String(showLocation.getBytes("ISO-8859-1"),"UTF-8");//字符转换 
			System.out.println("test--------------");
			response.setCharacterEncoding("UTF-8");
			response.setContentType("text/html");
			String result = showVenueSerivce.getVenue(showLocation);
		    response.getWriter().write(result);
		} catch (Exception e) {
			// TODO: handle exception
			logger.error(e);
		}
	}
	

	
}
