Skip to content

Commit

Permalink
[#140] refactor: 기존에 작업된 코드로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
JuHyun419 committed Jul 3, 2022
1 parent 895de82 commit 2c9ef32
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ class FolderController(
}

@ApiOperation(value = "폴더의 이름 조회 API")
@GetMapping("name/{folderId}")
fun getFolderName(@PathVariable @ApiParam(value = "폴더 ID", example = "2", required = true) folderId: Long)
@GetMapping("name/{folderToken}")
fun getFolderName(@PathVariable @ApiParam(value = "폴더 ID", example = "2", required = true) folderToken: String)
: ResponseEntity<FolderDto.FolderNameDto> {
return ResponseEntity.status(HttpStatus.OK).body(folderService.getFolderName(folderId))
return ResponseEntity.status(HttpStatus.OK).body(folderService.getFolderName(folderToken))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,9 @@ class FolderService(
return AccountDto.FolderBelongAccountListDto(accountList)
}

fun getFolderName(folderId: Long): FolderDto.FolderNameDto {
val folder = folderRepository.findFolderById(folderId) ?: throw FolderNotFoundException()
fun getFolderName(folderToken: String): FolderDto.FolderNameDto {
val folderId = aeS256Util.decrypt(folderToken)
val folder = folderRepository.findFolderById(folderId.toLong()) ?: throw FolderNotFoundException()
return FolderDto.FolderNameDto(folder.name)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ internal open class BookmarkServiceTest {

@Nested
inner class RestoreBookmark {
private lateinit var bookmark1: Bookmark
private lateinit var bookmark2: Bookmark
private val bookmark1 = Bookmark(1, 2, "www.naver.com")
private val bookmark2 = Bookmark(2, 1, "www.naver.com")

@Test
fun `휴지통에서 북마크를 복원한다`() {
Expand Down

0 comments on commit 2c9ef32

Please sign in to comment.