postCommentAdd method

Future<CommentAddResult> postCommentAdd(
  1. int illustId, {
  2. String comment = '',
  3. int? stampId,
  4. int? parentCommentId,
})

添加评论(评论一个插画)
illustId - 插画ID
comment - 评论内容
stampId - 表情包ID
parentCommentId - 父评论ID(用来回复)

Implementation

Future<CommentAddResult> postCommentAdd(
  int illustId, {
  String comment = '',
  int? stampId,
  int? parentCommentId,
}) async {
  return _httpClient
      .post<String>(
        '/v1/illust/comment/add',
        data: FormData.fromMap(
          {
            'illust_id': illustId,
            'comment': comment,
            'stamp_id': stampId,
            'parent_comment_id': parentCommentId,
          }..removeWhere((key, value) => null == value),
        ),
      )
      .then((response) => CommentAddResult.fromJson(jsonDecode(response.data!)));
}