h-lab/src/main/java/com/hlab/yanalyst/web/WebController.java
hehihoho3@gmail.com 418242f47d feat(comment-cards): 댓글 카드 페이지·사이드바·렌더/정렬/필터 추가
/comment-cards 라우트, 유튜브 스타일 카드 렌더, 정렬/임계값 필터, 전체 모자이크 토글

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 17:06:53 +09:00

94 lines
2.9 KiB
Java

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";
}
}