package com.buterfleoge.rabbit.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.buterfleoge.rabbit.view.PdfView;
import com.buterfleoge.whale.biz.travel.TravelBiz;
import com.buterfleoge.whale.type.protocol.order.GetContractRequest;
import com.buterfleoge.whale.type.protocol.travel.GetRouteRequest;
import com.buterfleoge.whale.type.protocol.travel.GetRouteResponse;

/**
 *
 * @author xiezhenzong
 *
 */
@Controller
@RequestMapping("/index")
public class IndexController {

    @Autowired
    private TravelBiz travelBiz;

    private List<Long> hotRouteidSet = new ArrayList<Long>(4);

    {
        hotRouteidSet.add(1L);
        hotRouteidSet.add(2L);
        hotRouteidSet.add(3L);
        hotRouteidSet.add(4L);
    }

    @ResponseBody
    @RequestMapping(value = "/hot", method = RequestMethod.GET)
    public GetRouteResponse getHotRoute(GetRouteRequest request) throws Exception {
        request.setRouteids(hotRouteidSet);
        GetRouteResponse response = new GetRouteResponse();
        travelBiz.getRoute(request, response);
        return response;
    }

    @RequestMapping(value = "/hxy_secure_notice", method = RequestMethod.GET)
    public ModelAndView getHxySecureNotice(GetContractRequest request) throws Exception {
        ModelAndView modelAndView = new ModelAndView("pdfView");
        modelAndView.addObject(PdfView.PATH_KEY, "classpath:hxy_secure_notice.pdf");
        return modelAndView;
    }

    @RequestMapping(value = "/hxy_signup_notice", method = RequestMethod.GET)
    public ModelAndView getHxyXXXNotice(GetContractRequest request) throws Exception {
        ModelAndView modelAndView = new ModelAndView("pdfView");
        modelAndView.addObject(PdfView.PATH_KEY, "classpath:hxy_signup_notice.pdf");
        return modelAndView;
    }

}

@@ -61,24 +61,49 @@
 .ArrayList;%0A
+import java.util.Arrays;%0A
 import java.
@@ -1465,32 +1465,410 @@
 esponse;%0A    %7D%0A%0A
+    @ResponseBody%0A    @RequestMapping(value = %22/wap/hot%22, method = RequestMethod.GET)%0A    public GetRouteResponse getWapHotRoute(GetRouteRequest request) throws Exception %7B%0A        request.setRouteids(Arrays.asList(hotRouteidSet.get(0)));%0A        GetRouteResponse response = new GetRouteResponse();%0A        travelBiz.getRoute(request, response);%0A        return response;%0A    %7D%0A%0A
     @RequestMapp

index web