更新评论
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user