-
Notifications
You must be signed in to change notification settings - Fork 3
feat: [NDGL-133] 어드민 페이지 사용자 요청 컨텐츠 목록 조회 #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
WooJJam
merged 4 commits into
develop
from
feature/NDGL-133-Server-어드민-페이지-사용자-요청-컨텐츠-목록-조회
May 14, 2026
The head ref may contain hidden characters: "feature/NDGL-133-Server-\uC5B4\uB4DC\uBBFC-\uD398\uC774\uC9C0-\uC0AC\uC6A9\uC790-\uC694\uCCAD-\uCEE8\uD150\uCE20-\uBAA9\uB85D-\uC870\uD68C"
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,3 +54,8 @@ CODEX.md | |
|
|
||
| ### ENV File ### | ||
| .env | ||
|
|
||
| docs | ||
|
|
||
| ### macOS ### | ||
| .DS_Store | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...p/ndgl/application/domains/admin/controller/AdminUserSuggestedTemplateViewController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| package com.yapp.ndgl.application.domains.admin.controller; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import org.springframework.stereotype.Controller; | ||
| import org.springframework.ui.Model; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RequestParam; | ||
|
|
||
| import com.yapp.ndgl.application.domains.travel.controller.dto.AdminUserSuggestedTemplateResponse; | ||
| import com.yapp.ndgl.application.domains.travel.facade.UserSuggestedTemplateFacade; | ||
| import com.yapp.ndgl.common.response.PageResponse; | ||
| import com.yapp.ndgl.common.type.SuggestionStatus; | ||
|
|
||
| import lombok.RequiredArgsConstructor; | ||
| import lombok.extern.slf4j.Slf4j; | ||
|
|
||
| @Slf4j | ||
| @Controller | ||
| @RequestMapping("/admin/user-suggested-templates") | ||
| @RequiredArgsConstructor | ||
| public class AdminUserSuggestedTemplateViewController { | ||
|
|
||
| private final UserSuggestedTemplateFacade userSuggestedTemplateFacade; | ||
|
|
||
| @GetMapping | ||
| public String listPage( | ||
| @RequestParam(value = "status", required = false) SuggestionStatus status, | ||
| @RequestParam(value = "page", defaultValue = "0") int page, | ||
| @RequestParam(value = "size", defaultValue = "12") int size, | ||
| Model model | ||
| ) { | ||
| try { | ||
| PageResponse<AdminUserSuggestedTemplateResponse> result = | ||
| userSuggestedTemplateFacade.readUserSuggestedTemplatesForAdmin(status, page, size); | ||
| model.addAttribute("templates", result.getContent()); | ||
| model.addAttribute("hasNext", result.isHasNext()); | ||
| model.addAttribute("hasPrevious", result.isHasPrevious()); | ||
| model.addAttribute("totalElements", result.getTotalElements()); | ||
| model.addAttribute("totalPages", result.getTotalPages()); | ||
| model.addAttribute("currentPage", page); | ||
| model.addAttribute("size", size); | ||
| model.addAttribute("status", status); | ||
| model.addAttribute("statuses", SuggestionStatus.values()); | ||
| } catch (Exception e) { | ||
| log.error("사용자 제안 템플릿 목록 조회 실패", e); | ||
| model.addAttribute("errorMessage", "목록을 불러오는 중 오류가 발생했습니다."); | ||
| model.addAttribute("templates", List.of()); | ||
| model.addAttribute("hasNext", false); | ||
| model.addAttribute("hasPrevious", false); | ||
| model.addAttribute("totalElements", 0L); | ||
| model.addAttribute("totalPages", 0); | ||
| model.addAttribute("currentPage", page); | ||
| model.addAttribute("size", size); | ||
| model.addAttribute("status", status); | ||
| model.addAttribute("statuses", SuggestionStatus.values()); | ||
| } | ||
| return "admin/user-suggested-template-list"; | ||
| } | ||
| } | ||
35 changes: 35 additions & 0 deletions
35
...pp/ndgl/application/domains/travel/controller/dto/AdminUserSuggestedTemplateResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package com.yapp.ndgl.application.domains.travel.controller.dto; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| import com.yapp.ndgl.common.type.DomesticRegion; | ||
| import com.yapp.ndgl.common.type.SuggestionStatus; | ||
| import com.yapp.ndgl.common.type.TravelCategory; | ||
| import com.yapp.ndgl.domain.travel.UserSuggestedTemplate; | ||
|
|
||
| public record AdminUserSuggestedTemplateResponse( | ||
| Long id, | ||
| String videoId, | ||
| String videoLink, | ||
| String recommendReason, | ||
| String suggesterUuid, | ||
| TravelCategory category, | ||
| DomesticRegion region, | ||
| SuggestionStatus status, | ||
| LocalDateTime createdAt | ||
| ) { | ||
|
|
||
| public static AdminUserSuggestedTemplateResponse toResponse(final UserSuggestedTemplate domain) { | ||
| return new AdminUserSuggestedTemplateResponse( | ||
| domain.getId(), | ||
| domain.getVideoId(), | ||
| domain.getVideoLink(), | ||
| domain.getRecommendReason(), | ||
| domain.getSuggesterUuid(), | ||
| domain.getCategory(), | ||
| domain.getRegion(), | ||
| domain.getStatus(), | ||
| domain.getCreatedAt() | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.