getUserDetail method

Future<UserDetail> getUserDetail(
  1. int userId, {
  2. required CancelToken cancelToken,
})

获取用户详细信息
如果没有查询到会返回404 : ErrorMessage.fromJson =>
userId - 用户ID

Implementation

Future<UserDetail> getUserDetail(
  int userId, {
  required CancelToken cancelToken,
}) async {
  final response = await _httpClient.get<String>(
    '/v1/user/detail',
    queryParameters: {
      'filter': 'for_android',
      'user_id': userId,
    },
    cancelToken: cancelToken,
  );
  final data = UserDetail.fromJson(jsonDecode(response.data!));
  return data;
}