新增评论回复功能

- 允许用户回复评论和子评论
- 点击回复按钮,弹出评论框,并显示回复的用户
- 评论
列表中显示回复的用户和内容
- 点击回复内容中的用户名,跳转到用户主页
- 优化评论列表加载逻辑,支持加载更多子评论
This commit is contained in:
2024-09-08 21:46:44 +08:00
parent 03a4db8a4b
commit 7c0d183571
16 changed files with 677 additions and 347 deletions

View File

@@ -61,7 +61,11 @@ data class ValidateTokenResult(
data class CommentRequestBody(
@SerializedName("content")
val content: String
val content: String,
@SerializedName("parentCommentId")
val parentCommentId: Int? = null,
@SerializedName("replyUserId")
val replyUserId: Int? = null,
)
data class ChangePasswordRequestBody(
@@ -149,7 +153,7 @@ interface RiderProAPI {
suspend fun createComment(
@Path("id") id: Int,
@Body body: CommentRequestBody
): Response<Unit>
): Response<DataContainer<Comment>>
@POST("comment/{id}/like")
suspend fun likeComment(
@@ -175,6 +179,7 @@ interface RiderProAPI {
@Query("postUser") postUser: Int? = null,
@Query("selfNotice") selfNotice: Int? = 0,
@Query("order") order: String? = null,
@Query("parentCommentId") parentCommentId: Int? = null,
): Response<ListContainer<Comment>>
@GET("account/my")