Exemplo n.º 1
0
 @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();
 }
Exemplo n.º 2
0
  /** 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";
  }
Exemplo n.º 3
0
  @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();
  }
Exemplo n.º 4
0
  @RequestMapping(value = "/updateTvDayOfWeek")
  public String updateTvDayOfWeek(Tv tv) {

    int result = tvService.updateTvDayOfWeek(tv);

    return "redirect:/manage";
  }
Exemplo n.º 5
0
  @RequestMapping(value = "/deleteTv")
  public String deleteTv(Long tvNo) {

    int result = tvService.deleteTv(tvNo);

    log.info("delete result " + result);

    return "redirect:/manage";
  }
Exemplo n.º 6
0
  @RequestMapping(value = "/updateTv")
  public String updateTv(Tv tv) {

    int result = tvService.updateTv(tv);

    log.info("tvTitle " + tv.getTvTitle() + ", result " + result);

    return "redirect:/manage";
  }
Exemplo n.º 7
0
  @RequestMapping(value = "/deleteTvContent")
  public String deleteTvContent(TvContent tvContent) {

    int result = tvService.deleteTvContent(tvContent.getContentNo());

    log.info("title " + tvContent.getTitle() + ", result " + result);

    return "redirect:/tvContentList?tvNo=" + tvContent.getTvNo();
  }
Exemplo n.º 8
0
  /** TV */
  @RequestMapping(value = "/manage")
  public String index(Model model) {

    List<Tv> tvs = tvService.selectTvs();

    DateTime dateTime = new DateTime();
    int dayOfWeek = dateTime.getDayOfWeek();

    dayOfWeek = dayOfWeek - 1;

    if (dayOfWeek == 0) {
      dayOfWeek = 7;
    }

    model.addAttribute("dayOfWeek", dayOfWeek);
    model.addAttribute("tvs", tvs);

    return "index";
  }