-
Notifications
You must be signed in to change notification settings - Fork 0
Feat: V3 배포 #222
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
Feat: V3 배포 #222
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
e872ca0
feat: 신고 객체에 스냅샷용 컬럼 추가
tishakong 5c262e1
refactor: customReason => detailReason으로 컬럼명 변경
tishakong cdf6f8c
refactor: post 레거시 객체 삭제
tishakong 4d3b136
refacor: Report 객체 내 from 함수 삭제 및 builder 구현
tishakong 91df90c
feat: Post, Comment 객체에 receiveReport 메서드 추가
tishakong 42c3eaf
refactor: Post, Comment 객체 통합에 따른 TargetType 수정
tishakong 5cd4ff0
comment: 리팩토링 TODO 주석 추가
tishakong eb7f711
feat: 게시글 신고, 댓글 신고 기능 구현
tishakong 0c3f965
refactor: 기획과 동일하게 ReportReason 설명 수정
tishakong 48ef46a
fix: 관리자 신고 기능 주석처리
tishakong 01051a1
fix: 관리자 신고 기능 주석처리
tishakong be4bca2
Merge branch 'main' into refactor/#195-post-comment-report
tishakong bdfe734
Merge pull request #219 from TackitOnboarding/refactor/#195-post-comm…
yeongsinkeem 15f2bfd
HOTFIX: s3 의존성 변경
tishakong b186569
feat: #214-마이페이지 현재 프로필 조회
yeongsinkeem 75cd46d
feat: #214-마이페이지 api
yeongsinkeem 377e49f
feat: #214-마이페이지 ) 프로필 편집, 프로필 전환 api 구현
yeongsinkeem ad7f479
refactor: #214-프로필 전환 기능에 따라 로그인 로직 리팩토링
yeongsinkeem b4d2584
feat: #214-마이페이지 api ) 댓글 조회 쿼리 추가
yeongsinkeem 14658f1
feat: #214-소유자 검증 메서드 및 에러코드 추가(마이페이지 검증용)
yeongsinkeem 8d6c459
refactor: #214-마이페이지 api AI 코드 리뷰 반영(소유자 검증 및 리팩토링)
yeongsinkeem 5c4335a
Merge pull request #220 from TackitOnboarding/feat/#214-mypage
tishakong 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
136 changes: 68 additions & 68 deletions
136
src/main/java/org/example/tackit/domain/admin/controller/AdminPostController.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 |
|---|---|---|
| @@ -1,68 +1,68 @@ | ||
| package org.example.tackit.domain.admin.controller; | ||
|
|
||
| import lombok.RequiredArgsConstructor; | ||
| import org.example.tackit.domain.admin.dto.ReportedPostDTO; | ||
| import org.example.tackit.domain.admin.service.ReportedPostService; | ||
| import org.example.tackit.domain.entity.Post; | ||
| import org.example.tackit.common.dto.PageResponseDTO; | ||
| import org.springframework.data.domain.Page; | ||
| import org.springframework.data.domain.Pageable; | ||
| import org.springframework.data.domain.Sort; | ||
| import org.springframework.data.web.PageableDefault; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.*; | ||
|
|
||
| import java.util.Map; | ||
|
|
||
| @RestController | ||
| @RequestMapping("/api/admin/report") | ||
| @RequiredArgsConstructor | ||
| public class AdminPostController { | ||
| private final Map<Post, ReportedPostService> reportedPostServices; | ||
|
|
||
| // 신고된 게시글 조회 | ||
| @GetMapping("/{postType}/posts") | ||
| public ResponseEntity<PageResponseDTO<ReportedPostDTO>> getReportedPosts( | ||
| @PathVariable("postType") Post postType, | ||
| @PageableDefault(size = 5, sort = "createdAt", direction = Sort.Direction.DESC) Pageable pageable) { | ||
| ReportedPostService service = reportedPostServices.get(postType); | ||
|
|
||
| if (service == null) { | ||
| throw new IllegalArgumentException("지원하지 않는 게시글 유형입니다: " + postType); | ||
| } | ||
|
|
||
| Page<ReportedPostDTO> posts = service.getDeletedPosts(pageable); | ||
| return ResponseEntity.ok(PageResponseDTO.from(posts)); | ||
| } | ||
|
|
||
| // 게시글 완전 삭제 | ||
| @DeleteMapping("/{postType}/posts/{postId}") | ||
| public ResponseEntity<Void> deleteReportedPost( | ||
| @PathVariable("postType") Post postType, | ||
| @PathVariable("postId") Long postId) { | ||
|
|
||
| ReportedPostService service = reportedPostServices.get(postType); | ||
| if (service == null) { | ||
| throw new IllegalArgumentException("지원하지 않는 게시글 유형입니다: " + postType); | ||
| } | ||
|
|
||
| service.deletePost(postId); | ||
| return ResponseEntity.noContent().build(); | ||
| } | ||
|
|
||
| // 게시글 활성화 | ||
| @PatchMapping("/{postType}/posts/{postId}/activate") | ||
| public ResponseEntity<String> activateReportedPost( | ||
| @PathVariable("postType") Post postType, | ||
| @PathVariable("postId") Long postId) { | ||
|
|
||
| ReportedPostService service = reportedPostServices.get(postType); | ||
| if (service == null) { | ||
| throw new IllegalArgumentException("지원하지 않는 게시글 유형입니다: " + postType); | ||
| } | ||
|
|
||
| service.activatePost(postId); | ||
| return ResponseEntity.ok("게시글이 활성화되었습니다."); | ||
| } | ||
|
|
||
| } | ||
| //package org.example.tackit.domain.admin.controller; | ||
| // | ||
| //import lombok.RequiredArgsConstructor; | ||
| //import org.example.tackit.domain.admin.dto.ReportedPostDTO; | ||
| //import org.example.tackit.domain.admin.service.ReportedPostService; | ||
| //import org.example.tackit.domain.entity.postType; | ||
| //import org.example.tackit.common.dto.PageResponseDTO; | ||
| //import org.springframework.data.domain.Page; | ||
| //import org.springframework.data.domain.Pageable; | ||
| //import org.springframework.data.domain.Sort; | ||
| //import org.springframework.data.web.PageableDefault; | ||
| //import org.springframework.http.ResponseEntity; | ||
| //import org.springframework.web.bind.annotation.*; | ||
| // | ||
| //import java.util.Map; | ||
| // | ||
| //@RestController | ||
| //@RequestMapping("/api/admin/report") | ||
| //@RequiredArgsConstructor | ||
| //public class AdminPostController { | ||
| // private final Map<Post, ReportedPostService> reportedPostServices; | ||
| // | ||
| // // 신고된 게시글 조회 | ||
| // @GetMapping("/{postType}/posts") | ||
| // public ResponseEntity<PageResponseDTO<ReportedPostDTO>> getReportedPosts( | ||
| // @PathVariable("postType") Post postType, | ||
| // @PageableDefault(size = 5, sort = "createdAt", direction = Sort.Direction.DESC) Pageable pageable) { | ||
| // ReportedPostService service = reportedPostServices.get(postType); | ||
| // | ||
| // if (service == null) { | ||
| // throw new IllegalArgumentException("지원하지 않는 게시글 유형입니다: " + postType); | ||
| // } | ||
| // | ||
| // Page<ReportedPostDTO> posts = service.getDeletedPosts(pageable); | ||
| // return ResponseEntity.ok(PageResponseDTO.from(posts)); | ||
| // } | ||
| // | ||
| // // 게시글 완전 삭제 | ||
| // @DeleteMapping("/{postType}/posts/{postId}") | ||
| // public ResponseEntity<Void> deleteReportedPost( | ||
| // @PathVariable("postType") Post postType, | ||
| // @PathVariable("postId") Long postId) { | ||
| // | ||
| // ReportedPostService service = reportedPostServices.get(postType); | ||
| // if (service == null) { | ||
| // throw new IllegalArgumentException("지원하지 않는 게시글 유형입니다: " + postType); | ||
| // } | ||
| // | ||
| // service.deletePost(postId); | ||
| // return ResponseEntity.noContent().build(); | ||
| // } | ||
| // | ||
| // // 게시글 활성화 | ||
| // @PatchMapping("/{postType}/posts/{postId}/activate") | ||
| // public ResponseEntity<String> activateReportedPost( | ||
| // @PathVariable("postType") Post postType, | ||
| // @PathVariable("postId") Long postId) { | ||
| // | ||
| // ReportedPostService service = reportedPostServices.get(postType); | ||
| // if (service == null) { | ||
| // throw new IllegalArgumentException("지원하지 않는 게시글 유형입니다: " + postType); | ||
| // } | ||
| // | ||
| // service.activatePost(postId); | ||
| // return ResponseEntity.ok("게시글이 활성화되었습니다."); | ||
| // } | ||
| // | ||
| //} | ||
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 was deleted.
Oops, something went wrong.
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
24 changes: 12 additions & 12 deletions
24
src/main/java/org/example/tackit/domain/entity/ReportReason.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 |
|---|---|---|
| @@ -1,20 +1,20 @@ | ||
| package org.example.tackit.domain.entity; | ||
|
|
||
| public enum ReportReason { | ||
| ADVERTISEMENT("광고 및 홍보성 게시물"), | ||
| DUPLICATE("중복 또는 도배성 게시물"), | ||
| FALSE_INFO("허위 정보 또는 사실 왜곡"), | ||
| IRRELEVANT("게시판 주제와 관련 없는 내용"), | ||
| ETC("기타"); | ||
| ADVERTISEMENT("광고 및 홍보성 내용"), | ||
| DUPLICATE("중복 또는 도배성 내용"), | ||
| FALSE_INFO("허위 정보 또는 사실 왜곡"), | ||
| IRRELEVANT("게시판 주제와 관련 없는 내용"), | ||
| ETC("기타"); | ||
|
|
||
| private final String description; | ||
| private final String description; | ||
|
|
||
| ReportReason(String description) { | ||
| this.description = description; | ||
| } | ||
| ReportReason(String description) { | ||
| this.description = description; | ||
| } | ||
|
|
||
| public String getDescription() { | ||
| return description; | ||
| } | ||
| public String getDescription() { | ||
| return description; | ||
| } | ||
| } | ||
|
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
파일 전체가 주석 처리되어 있습니다. 더 이상 사용하지 않는 코드라면 주석으로 남겨두기보다 파일을 삭제하여 코드 베이스를 깔끔하게 유지하는 것을 권장합니다. ExecutiveReportController.java 파일도 동일한 확인이 필요해 보입니다.