Skip to content

Commit 7b22df2

Browse files
authored
Merge pull request #170 from team-gogo/feature/community-image-upload
[community] 커뮤니티 게시글 이미지 업로드
2 parents b18b303 + 8b43692 commit 7b22df2

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

src/main/kotlin/gogo/gogostage/domain/community/board/application/BoardProcessor.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class BoardProcessor(
2626
commentCount = 0,
2727
likeCount = 0,
2828
isFiltered = false,
29-
createdAt = LocalDateTime.now()
29+
createdAt = LocalDateTime.now(),
30+
imageUrl = writeCommunityBoardDto.imageUrl,
3031
)
3132

3233
return boardRepository.save(board)

src/main/kotlin/gogo/gogostage/domain/community/board/persistence/Board.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ class Board(
3535
var isFiltered: Boolean,
3636

3737
@Column(name = "created_at", nullable = false)
38-
val createdAt: LocalDateTime
38+
val createdAt: LocalDateTime,
39+
40+
@Column(name = "image_url", length = 800, nullable = true)
41+
val imageUrl: String,
3942
) {
4043

4144
fun minusLikeCount() {

src/main/kotlin/gogo/gogostage/domain/community/root/application/dto/CommunityDto.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ data class WriteCommunityBoardDto(
1515
@Size(max = 1000)
1616
val content: String,
1717
@NotNull
18-
val gameCategory: GameCategory
18+
val gameCategory: GameCategory,
19+
val imageUrl: String,
1920
)
2021

2122
data class GetCommunityBoardResDto(
@@ -48,6 +49,7 @@ data class GetCommunityBoardInfoResDto(
4849
val isLiked: Boolean,
4950
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss")
5051
val createdAt: LocalDateTime,
52+
val imageUrl: String,
5153
val stage: StageDto,
5254
val commentCount: Int,
5355
val comment: List<CommentDto>

src/main/kotlin/gogo/gogostage/domain/community/root/persistence/CommunityCustomRepositoryImpl.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ class CommunityCustomRepositoryImpl(
123123
createdAt = board.createdAt,
124124
stage = stageDto,
125125
commentCount = board.commentCount,
126-
comment = commentDto
126+
comment = commentDto,
127+
imageUrl = board.imageUrl
127128
)
128129

129130
return response

0 commit comments

Comments
 (0)