@RequestMapping(value = "/updateTvContentTitle") public String updateTvContentTitle(TvContent tvContent) { Tv tv = tvService.selectTvByTvNo(tvContent.getTvNo()); tvContent.setTitle(tv.getTvTitle() + " " + tvContent.getTitle()); int result = tvService.updateTvContentTitle(tvContent); return "redirect:/tvContentList?tvNo=" + tvContent.getTvNo(); }
/** TV Contents */ @RequestMapping(value = "/tvContentList") public String tvContentList(Long tvNo, Model model) { Tv tv = tvService.selectTvByTvNo(tvNo); List<TvContent> tvContents = tvService.selectTvContents(tv); model.addAttribute("tv", tv); model.addAttribute("tvContents", tvContents); return "tv_content_list"; }
@RequestMapping(value = "/addTvContent") public String addTvContent(TvContent tvContent) { Tv tv = tvService.selectTvByTvNo(tvContent.getTvNo()); tvContent.setTitle(tv.getTvTitle() + " " + tvContent.getTitle()); int result = tvService.addTvContent(tvContent); log.info("title " + tvContent.getTitle() + ", result " + result); return "redirect:/tvContentList?tvNo=" + tvContent.getTvNo(); }