-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: dto 및 mapper 구현 * feat: 댓글방 목록 service 구현 * feat: 댓글방 목록 data source 구현 * feat: 댓글방 목록 repository 및 model 구현 * feat: 댓글방 목록 view type을 활용한 recyclerview 구현 및 데이터 바인딩 * feat: polling 기능 구현 * feat: 댓글 스크롤 구현 (새로운 댓글이 생길시 스크롤 아래로) * feat: 총대와 다른 참가자 이미지 리소스 파일
- Loading branch information
1 parent
8843bc2
commit 8c2b259
Showing
25 changed files
with
385 additions
and
29 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
android/app/src/main/java/com/zzang/chongdae/data/mapper/CommentCreatedAtMapper.kt
This file contains 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,11 @@ | ||
package com.zzang.chongdae.data.mapper | ||
|
||
import com.zzang.chongdae.data.remote.dto.response.CommentCreatedAtResponse | ||
import com.zzang.chongdae.domain.model.CommentCreatedAt | ||
|
||
fun CommentCreatedAtResponse.toDomain(): CommentCreatedAt { | ||
return CommentCreatedAt( | ||
date = this.date.toLocalDate(), | ||
time = this.time.toLocalTime(), | ||
) | ||
} |
14 changes: 14 additions & 0 deletions
14
android/app/src/main/java/com/zzang/chongdae/data/mapper/CommentsMapper.kt
This file contains 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,14 @@ | ||
package com.zzang.chongdae.data.mapper | ||
|
||
import com.zzang.chongdae.data.remote.dto.response.CommentResponse | ||
import com.zzang.chongdae.domain.model.Comment | ||
|
||
fun CommentResponse.toDomain(): Comment { | ||
return Comment( | ||
content = this.content, | ||
commentCreatedAt = this.commentCreatedAtResponse.toDomain(), | ||
isMine = this.isMine, | ||
isProposer = this.isProposer, | ||
nickname = this.nickname, | ||
) | ||
} |
6 changes: 6 additions & 0 deletions
6
android/app/src/main/java/com/zzang/chongdae/data/mapper/LocalDateTimeMapper.kt
This file contains 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,6 +1,12 @@ | ||
package com.zzang.chongdae.data.mapper | ||
|
||
import java.time.LocalDate | ||
import java.time.LocalDateTime | ||
import java.time.LocalTime | ||
import java.time.format.DateTimeFormatter | ||
|
||
fun String.toLocalDateTime(): LocalDateTime = LocalDateTime.parse(this, DateTimeFormatter.ISO_LOCAL_DATE_TIME) | ||
|
||
fun String.toLocalDate(): LocalDate = LocalDate.parse(this, DateTimeFormatter.ISO_LOCAL_DATE) | ||
|
||
fun String.toLocalTime(): LocalTime = LocalTime.parse(this, DateTimeFormatter.ISO_LOCAL_TIME) |
This file contains 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
12 changes: 12 additions & 0 deletions
12
...app/src/main/java/com/zzang/chongdae/data/remote/dto/response/CommentCreatedAtResponse.kt
This file contains 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,12 @@ | ||
package com.zzang.chongdae.data.remote.dto.response | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class CommentCreatedAtResponse( | ||
@SerialName("date") | ||
val date: String, | ||
@SerialName("time") | ||
val time: String, | ||
) |
18 changes: 18 additions & 0 deletions
18
android/app/src/main/java/com/zzang/chongdae/data/remote/dto/response/CommentResponse.kt
This file contains 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,18 @@ | ||
package com.zzang.chongdae.data.remote.dto.response | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable() | ||
data class CommentResponse( | ||
@SerialName("content") | ||
val content: String, | ||
@SerialName("createdAt") | ||
val commentCreatedAtResponse: CommentCreatedAtResponse, | ||
@SerialName("isMine") | ||
val isMine: Boolean, | ||
@SerialName("isProposer") | ||
val isProposer: Boolean, | ||
@SerialName("nickname") | ||
val nickname: String, | ||
) |
10 changes: 10 additions & 0 deletions
10
android/app/src/main/java/com/zzang/chongdae/data/remote/dto/response/CommentsResponse.kt
This file contains 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,10 @@ | ||
package com.zzang.chongdae.data.remote.dto.response | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class CommentsResponse( | ||
@SerialName("comments") | ||
val commentsResponse: List<CommentResponse>, | ||
) |
6 changes: 6 additions & 0 deletions
6
android/app/src/main/java/com/zzang/chongdae/data/remote/source/CommentDetailDataSource.kt
This file contains 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,10 +1,16 @@ | ||
package com.zzang.chongdae.data.remote.source | ||
|
||
import com.zzang.chongdae.data.remote.dto.request.CommentRequest | ||
import com.zzang.chongdae.data.remote.dto.response.CommentsResponse | ||
import com.zzang.chongdae.data.remote.dto.response.MeetingsResponse | ||
|
||
interface CommentDetailDataSource { | ||
suspend fun getMeetings(offeringId: Long): Result<MeetingsResponse> | ||
|
||
suspend fun saveComment(commentRequest: CommentRequest): Result<Unit> | ||
|
||
suspend fun fetchComments( | ||
offeringId: Long, | ||
memberId: Long, | ||
): Result<CommentsResponse> | ||
} |
This file contains 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 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
9 changes: 9 additions & 0 deletions
9
android/app/src/main/java/com/zzang/chongdae/domain/model/Comment.kt
This file contains 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,9 @@ | ||
package com.zzang.chongdae.domain.model | ||
|
||
data class Comment( | ||
val content: String, | ||
val commentCreatedAt: CommentCreatedAt, | ||
val isMine: Boolean, | ||
val isProposer: Boolean, | ||
val nickname: String, | ||
) |
9 changes: 9 additions & 0 deletions
9
android/app/src/main/java/com/zzang/chongdae/domain/model/CommentCreatedAt.kt
This file contains 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,9 @@ | ||
package com.zzang.chongdae.domain.model | ||
|
||
import java.time.LocalDate | ||
import java.time.LocalTime | ||
|
||
data class CommentCreatedAt( | ||
val date: LocalDate, | ||
val time: LocalTime, | ||
) |
This file contains 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 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 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
Oops, something went wrong.