-
Notifications
You must be signed in to change notification settings - Fork 0
Feat: 백오피스 개발 #165
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
Merged
Feat: 백오피스 개발 #165
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
6fc8292
feat: admin type 추가
MoonMinHyuk1 d1b966c
feat: record review domain
MoonMinHyuk1 d00000b
feat: record review api
MoonMinHyuk1 ab8eddb
feat: admin type 추가
MoonMinHyuk1 3d5e304
feat: record comment api
MoonMinHyuk1 ecb86fd
feat: record category domain
MoonMinHyuk1 37d5ab0
feat: record category api
MoonMinHyuk1 87afc09
feat: record domain
MoonMinHyuk1 5069d5d
feat: record dto
MoonMinHyuk1 c0e857c
feat: record api
MoonMinHyuk1 a00f181
refactor: page 반환타입 수정
MoonMinHyuk1 c6d2eee
feat: record dto
MoonMinHyuk1 440d52b
feat: record domain
MoonMinHyuk1 01e2cd7
refactor: status 조건 추가
MoonMinHyuk1 54be018
feat: scheduler
MoonMinHyuk1 6170e97
feat: record review apply domain
MoonMinHyuk1 7bc8493
feat: record review apply dto
MoonMinHyuk1 2ab041d
feat: record review apply api
MoonMinHyuk1 42fbd72
feat: record review domain
MoonMinHyuk1 630103c
feat: record review dto
MoonMinHyuk1 2ad7b13
feat: record review error
MoonMinHyuk1 89a045d
feat: record review api
MoonMinHyuk1 0db42f1
restore
MoonMinHyuk1 118afc7
Merge branch 'dev' into feat/back-office
MoonMinHyuk1 b749f1f
feat: scheduling
MoonMinHyuk1 93fd4d8
Merge branch 'dev' into feat/back-office
MoonMinHyuk1 6e394c1
feat: record comment domain
MoonMinHyuk1 c5dd45c
feat: record comment dto
MoonMinHyuk1 63ca333
feat: record comment api
MoonMinHyuk1 ec3753d
feat: record comment
MoonMinHyuk1 e855d17
refactor: refactor dto
MoonMinHyuk1 2adfe7e
refactor: admin validation
MoonMinHyuk1 6d62b61
refactor: refactor dto
MoonMinHyuk1 38e1aab
refactor: 구조 변경
MoonMinHyuk1 44296d0
test: service test
MoonMinHyuk1 114be20
Merge branch 'dev' into feat/back-office
MoonMinHyuk1 f14b7a4
refactor: refactor dto
MoonMinHyuk1 590d594
refactor: 조회 쿼리 수정
MoonMinHyuk1 308d6ab
refactor: refactor dto
MoonMinHyuk1 fbf6d6a
test: service test
MoonMinHyuk1 2087e9f
test: controller test
MoonMinHyuk1 8a168ef
refactor: error code 수정
MoonMinHyuk1 2903dd3
refactor: refactor enum
MoonMinHyuk1 ba3f62c
test: controller test
MoonMinHyuk1 b695f4e
docs: record category api 명세서
MoonMinHyuk1 4914c89
test: controller test
MoonMinHyuk1 f0f084e
docs: record review api 명세서
MoonMinHyuk1 2930f43
refactor: 서비스 구조 변경
MoonMinHyuk1 bee4614
test: controller test
MoonMinHyuk1 42ef7b5
docs: record review api 명세서
MoonMinHyuk1 82c261e
docs: record comment api 명세서
MoonMinHyuk1 692867d
refactor: 변수명 변경
MoonMinHyuk1 4fca1c7
test: service test
MoonMinHyuk1 e6b4a93
test: controller test
MoonMinHyuk1 6b6dec2
docs: record review api 명세서
MoonMinHyuk1 b9487c6
refactor: refactor dto
MoonMinHyuk1 6a7c31a
refactor: 쿼리 수정
MoonMinHyuk1 2a17265
test: service test
MoonMinHyuk1 654d451
refactor: 변수 타입 변경
MoonMinHyuk1 492ad76
test: controller test
MoonMinHyuk1 4426912
docs: record category api 명세서
MoonMinHyuk1 10dee1d
docs: record api 명세서
MoonMinHyuk1 ae789a7
docs: api 명세서
MoonMinHyuk1 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
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,119 @@ | ||
| == Record API | ||
|
|
||
| === 1. 레코드 저장 | ||
| ---- | ||
| part | ||
|
|
||
| web, server, infra, all | ||
| ---- | ||
| ---- | ||
| type - category | ||
|
|
||
| odori - culture | ||
| retro - retrospection | ||
| tech - disaster | ||
| tech - issue | ||
| tech - new_tech | ||
| tech - architecture | ||
| ---- | ||
| ===== Request | ||
| include::{snippets}/save-record/http-request.adoc[] | ||
| ===== Response - Success | ||
| include::{snippets}/save-record/http-response.adoc[] | ||
|
|
||
| === 2. 레코드 수정 | ||
| ===== Request | ||
| include::{snippets}/update-record/http-request.adoc[] | ||
| ===== Response - Success | ||
| include::{snippets}/update-record/http-response.adoc[] | ||
|
|
||
| === 3. 레코드 삭제 | ||
| ===== Request | ||
| include::{snippets}/delete-record/http-request.adoc[] | ||
| ===== Response - Success | ||
| include::{snippets}/delete-record/http-response.adoc[] | ||
|
|
||
| === 4. 핫 레코드 목록 조회 | ||
| ===== Request | ||
| include::{snippets}/get-hot-records/http-request.adoc[] | ||
| ===== Response - Success | ||
| include::{snippets}/get-hot-records/http-response.adoc[] | ||
|
|
||
| === 5. 레코드 목록 조회 | ||
| ---- | ||
| /api/v1/record/{part}/{type}?category=&page= | ||
| ---- | ||
| ---- | ||
| part | ||
|
|
||
| web, server, infra, all | ||
| ---- | ||
| ---- | ||
| type - category | ||
|
|
||
| odori - culture | ||
| retro - retrospection | ||
| tech - disaster | ||
| tech - issue | ||
| tech - new_tech | ||
| tech - architecture | ||
| all - x | ||
| ---- | ||
| ---- | ||
| page : 레코드 목록 페이지 번호 (0부터 1페이지) | ||
| ---- | ||
| ===== Request | ||
| include::{snippets}/get-records/http-request.adoc[] | ||
| ===== Response - Success | ||
| include::{snippets}/get-records/http-response.adoc[] | ||
|
|
||
| === 6. 레코드 조회 | ||
| ---- | ||
| page : 댓글 목록 페이지 번호 (0부터 1페이지) | ||
| ---- | ||
| ---- | ||
| level : 댓글 / 대댓글 / 대대댓글 구분 (1 - 댓글, 2 - 대댓글 ...) | ||
| ---- | ||
| ===== Request | ||
| include::{snippets}/get-record/http-request.adoc[] | ||
| ===== Response - Success | ||
| include::{snippets}/get-record/http-response.adoc[] | ||
|
|
||
| === 7. 레코드 조회 - 리뷰 | ||
| ---- | ||
| reviews : 리뷰 댓글 | ||
| reviews.status : 리뷰 상태 (approve - 승인, reject - 반려, mine - 레코드 작성자) | ||
| reviewers : 리뷰 신청자 (approve - 승인, reject - 반려, wait - 대기) | ||
| ---- | ||
| ===== Request | ||
| include::{snippets}/get-record-with-review/http-request.adoc[] | ||
| ===== Response - Success | ||
| include::{snippets}/get-record-with-review/http-response.adoc[] | ||
|
|
||
| === 8. 레코드 목록 조회 - 리뷰 받는 사람 | ||
| ---- | ||
| page : 레코드 목록 페이지 번호 (0부터 1페이지) | ||
|
|
||
| status | ||
| wait : 내가 작성한 글 중 대기상태인 글 | ||
| approve : 내가 작성한 글 중 승인 처리된 글 | ||
| reject : 내가 작성한 글 중 반려 처리된 글 | ||
| ---- | ||
| ===== Request | ||
| include::{snippets}/get-reviewee-records/http-request.adoc[] | ||
| ===== Response - Success | ||
| include::{snippets}/get-reviewee-records/http-response.adoc[] | ||
|
|
||
| === 9. 레코드 목록 조회 - 리뷰 하는 사람 | ||
| ---- | ||
| page : 레코드 목록 페이지 번호 (0부터 1페이지) | ||
|
|
||
| status | ||
| wait : 내가 아직 리뷰하지 않은 글 | ||
| approve : 내가 승인 처리한 글 | ||
| reject : 내가 반려 처리한 글 | ||
| ---- | ||
| ===== Request | ||
| include::{snippets}/get-reviewer-records/http-request.adoc[] | ||
| ===== Response - Success | ||
| include::{snippets}/get-reviewer-records/http-response.adoc[] |
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,24 @@ | ||
| == Record Category API | ||
|
|
||
| ---- | ||
| category | ||
|
|
||
| culture (오도리 - 팀 내 문화) | ||
| retrospection (회고 - 회고) | ||
| disaster (기술 - 장애 관리) | ||
| issue (기술 - 이슈 관리) | ||
| new_tech (기술 - 신 기술) | ||
| architecture (기술 - 설계) | ||
| ---- | ||
|
|
||
| === 1. 템플릿 저장 | ||
| ===== Request | ||
| include::{snippets}/update-template/http-request.adoc[] | ||
| ===== Response | ||
| include::{snippets}/update-template/http-response.adoc[] | ||
|
|
||
| === 2. 템플릿 조회 | ||
| ===== Request | ||
| include::{snippets}/get-template/http-request.adoc[] | ||
| ===== Response | ||
| include::{snippets}/get-template/http-response.adoc[] |
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,23 @@ | ||
| == Record Comment API | ||
|
|
||
| ---- | ||
| parent_id : 부모 댓글 아이디 | ||
| ---- | ||
|
|
||
| === 1. 댓글 저장 | ||
| ===== Request | ||
| include::{snippets}/save-record-comment/http-request.adoc[] | ||
| ===== Response | ||
| include::{snippets}/save-record-comment/http-response.adoc[] | ||
|
|
||
| === 2. 댓글 수정 | ||
| ===== Request | ||
| include::{snippets}/update-record-comment/http-request.adoc[] | ||
| ===== Response | ||
| include::{snippets}/update-record-comment/http-response.adoc[] | ||
|
|
||
| === 3. 댓글 삭제 | ||
| ===== Request | ||
| include::{snippets}/delete-record-comment/http-request.adoc[] | ||
| ===== Response | ||
| include::{snippets}/delete-record-comment/http-response.adoc[] |
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,33 @@ | ||
| == Record Review API | ||
|
|
||
| ---- | ||
| status | ||
|
|
||
| approve (승인) | ||
| reject (반려) | ||
| mine (레코드 작성자가 리뷰를 달 때) | ||
| ---- | ||
|
|
||
| === 1. 리뷰 저장 | ||
| ===== Request | ||
| include::{snippets}/save-record-review/http-request.adoc[] | ||
| ===== Response - Success | ||
| include::{snippets}/save-record-review/http-response.adoc[] | ||
| ===== Response - Fail | ||
| include::{snippets}/save-record-review-exception/http-response.adoc[] | ||
|
|
||
| === 2. 리뷰 수정 | ||
| ===== Request | ||
| include::{snippets}/update-record-review/http-request.adoc[] | ||
| ===== Response - Success | ||
| include::{snippets}/update-record-review/http-response.adoc[] | ||
| ===== Response - Fail | ||
| include::{snippets}/update-record-review-exception/http-response.adoc[] | ||
|
|
||
| === 3. 리뷰 삭제 | ||
| ===== Request | ||
| include::{snippets}/delete-record-review/http-request.adoc[] | ||
| ===== Response - Success | ||
| include::{snippets}/delete-record-review/http-response.adoc[] | ||
| ===== Response - Fail | ||
| include::{snippets}/delete-record-review-exception/http-response.adoc[] |
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
112 changes: 112 additions & 0 deletions
112
src/main/kotlin/com/example/jhouse_server/domain/record/controller/RecordController.kt
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,112 @@ | ||
| package com.example.jhouse_server.domain.record.controller | ||
|
|
||
| import com.example.jhouse_server.domain.record.dto.* | ||
| import com.example.jhouse_server.domain.record.service.RecordService | ||
| import com.example.jhouse_server.domain.user.entity.Authority.ADMIN | ||
| import com.example.jhouse_server.domain.user.entity.User | ||
| import com.example.jhouse_server.global.annotation.Auth | ||
| import com.example.jhouse_server.global.annotation.AuthUser | ||
| import com.example.jhouse_server.global.bucket.RateLimitService | ||
| import com.example.jhouse_server.global.response.ApplicationResponse | ||
| import org.springframework.data.domain.Pageable | ||
| import org.springframework.data.web.PageableDefault | ||
| import org.springframework.validation.annotation.Validated | ||
| import org.springframework.web.bind.annotation.DeleteMapping | ||
| import org.springframework.web.bind.annotation.GetMapping | ||
| import org.springframework.web.bind.annotation.PathVariable | ||
| import org.springframework.web.bind.annotation.PostMapping | ||
| import org.springframework.web.bind.annotation.PutMapping | ||
| import org.springframework.web.bind.annotation.RequestBody | ||
| import org.springframework.web.bind.annotation.RequestMapping | ||
| import org.springframework.web.bind.annotation.RequestParam | ||
| import org.springframework.web.bind.annotation.RestController | ||
| import javax.servlet.http.HttpServletRequest | ||
|
|
||
| @RestController | ||
| @RequestMapping("/api/v1/record") | ||
| class RecordController( | ||
| private val recordService: RecordService, | ||
| private val rateLimitService: RateLimitService | ||
| ) { | ||
|
|
||
| @Auth(ADMIN) | ||
| @PostMapping | ||
| fun saveRecord( | ||
| @Validated @RequestBody recordReqDto: RecordReqDto, | ||
| @AuthUser user: User | ||
| ): ApplicationResponse<Long> { | ||
| return ApplicationResponse.ok(recordService.saveRecord(recordReqDto, user)) | ||
| } | ||
|
|
||
| @Auth(ADMIN) | ||
| @PutMapping("/{record_id}") | ||
| fun updateRecord( | ||
| @Validated @RequestBody recordUpdateDto: RecordUpdateDto, | ||
| @AuthUser user: User, | ||
| @PathVariable("record_id") recordId: Long | ||
| ): ApplicationResponse<Long> { | ||
| return ApplicationResponse.ok(recordService.updateRecord(recordUpdateDto, user, recordId)) | ||
| } | ||
|
|
||
| @Auth(ADMIN) | ||
| @DeleteMapping("/{record_id}") | ||
| fun deleteRecord( | ||
| @AuthUser user: User, | ||
| @PathVariable("record_id") recordId: Long | ||
| ): ApplicationResponse<Nothing> { | ||
| recordService.deleteRecord(user, recordId) | ||
| return ApplicationResponse.ok() | ||
| } | ||
|
|
||
| @GetMapping("/hot") | ||
| fun getHotRecords(): ApplicationResponse<RecordHotResDto> { | ||
| return ApplicationResponse.ok(recordService.getHotRecords()) | ||
| } | ||
|
|
||
| @GetMapping("/{part}/{type}") | ||
| fun getRecords( | ||
| @PathVariable("part") part: String, | ||
| @PathVariable("type") type: String, | ||
| @RequestParam(value = "category", defaultValue = "") category: String, | ||
| @PageableDefault(size = 4) pageable: Pageable | ||
| ): ApplicationResponse<RecordPageResDto> { | ||
| return ApplicationResponse.ok(recordService.getRecords(RecordPageCondition(part, type, category), pageable)) | ||
| } | ||
|
|
||
| @GetMapping("/{record_id}") | ||
| fun getRecord( | ||
| @PathVariable("record_id") recordId: Long, | ||
| request: HttpServletRequest, | ||
| @PageableDefault(size = 10) pageable: Pageable | ||
| ): ApplicationResponse<RecordResDto> { | ||
| return ApplicationResponse.ok(recordService.getRecord(recordId, rateLimitService.getClientIp(request), pageable)) | ||
| } | ||
|
|
||
| @Auth(ADMIN) | ||
| @GetMapping("/review/{record_id}") | ||
| fun getRecordWithReview( | ||
| @PathVariable("record_id") recordId: Long | ||
| ): ApplicationResponse<RecordWithReviewResDto> { | ||
| return ApplicationResponse.ok(recordService.getRecordWithReview(recordId)) | ||
| } | ||
|
|
||
| @Auth(ADMIN) | ||
| @GetMapping("/reviewee") | ||
| fun getRevieweeRecords( | ||
| @RequestParam("status", required = false) status: String?, | ||
| @AuthUser user: User, | ||
| @PageableDefault(size = 3) pageable: Pageable | ||
| ): ApplicationResponse<RecordPageResDto> { | ||
| return ApplicationResponse.ok(recordService.getRevieweeRecords(RecordReviewCondition(status), user, pageable)) | ||
| } | ||
|
|
||
| @Auth(ADMIN) | ||
| @GetMapping("/reviewer") | ||
| fun getReviewerRecords( | ||
| @RequestParam("status", required = false) status: String?, | ||
| @AuthUser user: User, | ||
| @PageableDefault(size = 3) pageable: Pageable | ||
| ): ApplicationResponse<RecordPageResDto> { | ||
| return ApplicationResponse.ok(recordService.getReviewerRecords(RecordReviewCondition(status), user, pageable)) | ||
| } | ||
| } | ||
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.
페이징 처리에서 디폴드 값이 10인 이유가 있나요..? 위에 API는 4로 지정되어 있어서 여쭤봅니다.
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.
레코드 단건 조회에서의 페이징은 댓글에 대한 페이징이어서 제가 임의로 10개로 설정해두었습니다!