i-framework-lite/.svn/pristine/60/60db009cba4b99e17d946ac341f...

151 lines
4.7 KiB
Plaintext

package kr.co.i4way.sample.web;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import kr.co.i4way.common.CommandMap;
import kr.co.i4way.sample.model.TestListVo;
import kr.co.i4way.sample.model.WallInfoVo;
import kr.co.i4way.sample.service.SampleService;
@Controller
public class SampleController {
@Autowired(required=true)
private SampleService service;
//화면이 열림과 동시에 데이터를 보여줘야 하는경우
@RequestMapping("/welcome")
public String welcome() throws Exception{
return "/welcome";
}
@RequestMapping("/ws_sample")
public String websocket_sample() throws Exception{
return "/websocket/ws_sample";
}
@RequestMapping(value="/wall_main")
public ModelAndView wall_main() throws Exception{
ModelAndView mv = new ModelAndView("/sample/wall_main");
return mv;
}
@RequestMapping(value="/background_test")
public ModelAndView background_test() throws Exception{
ModelAndView mv = new ModelAndView("/sample/sample1");
return mv;
}
@RequestMapping(value="/background_test2")
public ModelAndView background_test2() throws Exception{
ModelAndView mv = new ModelAndView("/sample/sample2");
return mv;
}
@RequestMapping(value="/background_test2_1")
public ModelAndView background_test2_1() throws Exception{
ModelAndView mv = new ModelAndView("/sample/sample2_1");
return mv;
}
@RequestMapping(value="/background_test2_2")
public ModelAndView background_test2_2() throws Exception{
ModelAndView mv = new ModelAndView("/sample/sample2_2");
return mv;
}
@RequestMapping(value="/background_test2_3")
public ModelAndView background_test2_3() throws Exception{
ModelAndView mv = new ModelAndView("/sample/sample2_3");
return mv;
}
@RequestMapping(value="/background_test3_1")
public ModelAndView background_test3_1() throws Exception{
ModelAndView mv = new ModelAndView("/sample/sample3_1");
return mv;
}
@RequestMapping(value="/background_test3_2")
public ModelAndView background_test3_2() throws Exception{
ModelAndView mv = new ModelAndView("/sample/sample3_2");
return mv;
}
@RequestMapping(value="/background_test3_3")
public ModelAndView background_test3_3() throws Exception{
ModelAndView mv = new ModelAndView("/sample/sample3_3");
return mv;
}
@RequestMapping(value="/wall/openWall")
public ModelAndView openWall() throws Exception{
ModelAndView mv = new ModelAndView("/wall/index");
return mv;
}
@RequestMapping(value="/wall/w_call")
public ModelAndView openWall_call() throws Exception{
ModelAndView mv = new ModelAndView("/wall/wall_call");
return mv;
}
@RequestMapping(value="/wall/w_picture")
public ModelAndView openWall_picture() throws Exception{
ModelAndView mv = new ModelAndView("/wall/wall_picture");
return mv;
}
@RequestMapping(value="/wall/w_movie")
public ModelAndView openWall_movie() throws Exception{
ModelAndView mv = new ModelAndView("/wall/wall_movie");
return mv;
}
@RequestMapping(value="/web_edit_sample")
public ModelAndView web_edit_sample() throws Exception{
ModelAndView mv = new ModelAndView("/sample/web_edit_sample");
return mv;
}
//화면이 열림과 동시에 데이터를 보여줘야 하는경우
@RequestMapping("/getDual")
public ModelAndView getDual() throws Exception{
ModelAndView mv = new ModelAndView("/welcome");
mv.addObject("time", service.getDual());
return mv;
}
@RequestMapping("/getTestList")
public @ResponseBody Map<String , Object> getTestList(@ModelAttribute("testlistvo") TestListVo testlistvo) throws Exception{
Map<String, Object> rtnObject = new HashMap<String, Object>();
rtnObject.put("list", service.getTestList(testlistvo));
rtnObject.put("param", testlistvo);
return rtnObject;
}
@RequestMapping("/getWallInfo")
public @ResponseBody Map<String , Object> getWallInfo(@ModelAttribute("wallinfovo") WallInfoVo wallinfovo) throws Exception{
Map<String, Object> rtnObject = new HashMap<String, Object>();
wallinfovo.setQuery_arry(wallinfovo.getCenter_id().split(","));
rtnObject.put("list", service.getWallInfo(wallinfovo));
rtnObject.put("param", wallinfovo);
return rtnObject;
}
}