package com.hlab.yanalyst.web; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; @Controller public class WebController { private final com.hlab.yanalyst.domain.production.ProductionService productionService; private final com.hlab.yanalyst.domain.channel.ChannelService channelService; public WebController(com.hlab.yanalyst.domain.production.ProductionService productionService, com.hlab.yanalyst.domain.channel.ChannelService channelService) { this.productionService = productionService; this.channelService = channelService; } @GetMapping("/") public String dashboard(Model model) { model.addAttribute("currentPage", "dashboard"); return "dashboard"; } @GetMapping("/channels") public String channels(Model model) { model.addAttribute("currentPage", "channels"); model.addAttribute("channels", channelService.getAllChannels()); return "channels"; } @GetMapping("/videos") public String videos(Model model) { model.addAttribute("currentPage", "videos"); return "videos"; } @GetMapping("/collection") public String collection(Model model) { model.addAttribute("currentPage", "collection"); return "collection"; } @GetMapping("/board") public String board(Model model) { model.addAttribute("currentPage", "board"); return "board"; } @GetMapping("/discover") public String discover(Model model) { model.addAttribute("currentPage", "discover"); return "discover"; } @GetMapping("/recommend") public String recommend(Model model) { model.addAttribute("currentPage", "recommend"); return "recommend"; } @GetMapping("/publish") public String publish(Model model) { model.addAttribute("currentPage", "publish"); return "publish"; } @GetMapping("/rework/{id}") public String rework(@org.springframework.web.bind.annotation.PathVariable Long id, Model model) { model.addAttribute("currentPage", "collection"); model.addAttribute("videoId", id); return "rework"; } @GetMapping("/comment-cards") public String commentCards(Model model) { model.addAttribute("currentPage", "comment-cards"); return "comment-cards"; } @GetMapping("/production") public String production(Model model) { model.addAttribute("currentPage", "production"); model.addAttribute("historyList", productionService.getAllHistory()); return "production"; } @GetMapping("/production/{id}") public String productionDetail(@org.springframework.web.bind.annotation.PathVariable Long id, Model model) { model.addAttribute("currentPage", "production"); model.addAttribute("history", productionService.getHistory(id)); return "production_detail"; } }