mod: 楼中楼回复

This commit is contained in:
guozhigq
2023-04-28 23:05:29 +08:00
parent b85c89e805
commit e971fbc876
7 changed files with 136 additions and 12 deletions

View File

@ -16,4 +16,7 @@ class Api {
// 评论列表
static const String replyList = '/x/v2/reply';
// 楼中楼
static const String replyReplyList = '/x/v2/reply/reply';
}

View File

@ -33,4 +33,38 @@ class ReplyHttp {
};
}
}
static Future replyReplyList({
required String oid,
required String root,
required int pageNum,
required int type,
int sort = 1,
}) async {
var res = await Request().get(Api.replyReplyList, data: {
'oid': oid,
'root': root,
'pn': pageNum,
'type': type,
'sort': 1,
});
if (res.data['code'] == 0) {
return {
'status': true,
'data': res.data['data'],
};
} else {
Map errMap = {
-400: '请求错误',
-404: '无此项',
12002: '评论区已关闭',
12009: '评论主体的type不合法',
};
return {
'status': false,
'date': [],
'msg': errMap[res.data['code']] ?? '请求异常',
};
}
}
}