Skip to content

Commit

Permalink
Merge pull request #173 from themoment-team/fix/delete-board-list-fil…
Browse files Browse the repository at this point in the history
…e-field

게시글 리스트 파일 필드 제거
  • Loading branch information
tlsgmltjd authored Jun 18, 2024
2 parents 5578d7d + c198bc1 commit 6bf5a40
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class BoardController (
) {

@PostMapping
fun saveBoard(@Valid @RequestBody boardSaveDto: BoardSaveDto): ResponseEntity<BoardListDto> {
fun saveBoard(@Valid @RequestBody boardSaveDto: BoardSaveDto): ResponseEntity<BoardInfoDto> {
val authenticationId = authenticatedUserManager.getName()
return ResponseEntity.status(HttpStatus.CREATED).body(saveBoardUseCase.saveBoard(boardSaveDto, authenticationId))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ data class BoardListDto (
val likeCount: Int,
val isLike: Boolean,
val isPinned: Boolean,
val fileUrlsDto: FileUrlsDto
)
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class BoardCustomRepositoryImpl(
board.likes.size(),
likeCase(user),
board.isPinned,
board.fileUrls
)
)
.from(board)
Expand Down Expand Up @@ -88,7 +87,6 @@ class BoardCustomRepositoryImpl(
board.likes.size(),
likeCase(user),
board.isPinned,
board.fileUrls
)
)
.from(board)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package team.themoment.gsmNetworking.domain.board.service

import team.themoment.gsmNetworking.domain.board.dto.BoardInfoDto
import team.themoment.gsmNetworking.domain.board.dto.BoardListDto
import team.themoment.gsmNetworking.domain.board.dto.BoardSaveDto

interface SaveBoardUseCase {
fun saveBoard(boardSaveDto: BoardSaveDto, authenticationId: Long): BoardListDto
fun saveBoard(boardSaveDto: BoardSaveDto, authenticationId: Long): BoardInfoDto
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import team.themoment.gsmNetworking.domain.popup.repository.PopupRepository
import team.themoment.gsmNetworking.domain.user.repository.UserRepository
import team.themoment.gsmNetworking.thirdParty.aws.s3.service.FileUploadUseCase
import java.time.LocalDateTime
import java.util.Arrays
import java.util.Collections
import javax.mail.internet.MimeMessage

Expand All @@ -52,7 +53,7 @@ class BoardService (
UpdateBoardUseCase
{
@Transactional
override fun saveBoard(boardSaveDto: BoardSaveDto, authenticationId: Long): BoardListDto {
override fun saveBoard(boardSaveDto: BoardSaveDto, authenticationId: Long): BoardInfoDto {
val currentUser = userRepository.findByAuthenticationId(authenticationId)
?: throw ExpectedException("유저를 찾을 수 없습니다.", HttpStatus.NOT_FOUND)

Expand Down Expand Up @@ -93,9 +94,10 @@ class BoardService (
sendEmailToMentors(savedBoard.id, savedBoard.title)
}

return BoardListDto(
return BoardInfoDto(
id = savedBoard.id,
title = savedBoard.title,
content = savedBoard.content,
boardCategory = savedBoard.boardCategory,
author = AuthorDto(
id = savedBoard.author.id,
Expand All @@ -105,11 +107,11 @@ class BoardService (
defaultImgNumber = savedBoard.author.defaultImgNumber
),
createdAt = savedBoard.createdAt,
commentCount = 0,
comments = Arrays.asList(),
likeCount = 0,
isLike = false,
isPinned = savedBoard.isPinned,
fileUrlsDto = fileUrlsDto
fileUrls = fileUrlsDto.fileUrls
)

}
Expand Down

0 comments on commit 6bf5a40

Please sign in to comment.