package com.cab.controller;

import com.cab.model.CabLiveContent;
import com.cab.service.CabLiveContentServiceImpl;
import com.cku.util.ServletUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by user on 2016/6/27.
 */
@Controller
public class PlayerController {
    @Autowired
    public CabLiveContentServiceImpl cabLiveContentService;
    @RequestMapping("/player")
    public ModelAndView player(HttpServletRequest request, HttpServletResponse response){
        ModelAndView result = new ModelAndView("player");
        Long selectId = ServletUtils.getParameterLong(request,"id",null);
        CabLiveContent cabLiveContent = cabLiveContentService.selectByPrimaryKey(selectId);
        List<CabLiveContent> nextList = cabLiveContentService.queryList(selectId);
        result.addObject("content",cabLiveContent);
        result.addObject("nextList",nextList);
        return result;
    }
}
