更新评论

This commit is contained in:
2024-09-09 13:06:05 +08:00
parent 7617c48f54
commit f804e512a9
6 changed files with 79 additions and 30 deletions

View File

@@ -41,7 +41,8 @@ interface CommentService {
postId: Int,
content: String,
parentCommentId: Int? = null,
replyUserId: Int? = null
replyUserId: Int? = null,
replyCommentId: Int? = null
): CommentEntity
/**
@@ -203,10 +204,16 @@ class CommentServiceImpl : CommentService {
content: String,
parentCommentId: Int?,
replyUserId: Int?,
replyCommentId: Int?
): CommentEntity {
val resp = ApiClient.api.createComment(
postId,
CommentRequestBody(content, parentCommentId, replyUserId),
CommentRequestBody(
content = content,
parentCommentId = parentCommentId,
replyUserId = replyUserId,
replyCommentId = replyCommentId
),
)
val body = resp.body() ?: throw ServiceException("Failed to create comment")
return body.data.toCommentEntity()

View File

@@ -66,6 +66,8 @@ data class CommentRequestBody(
val parentCommentId: Int? = null,
@SerializedName("replyUserId")
val replyUserId: Int? = null,
@SerializedName("replyCommentId")
val replyCommentId: Int? = null,
)
data class ChangePasswordRequestBody(