getAppAccountList method

Future<GetAccountListResponse> getAppAccountList(
  1. GetAccountListRequest params
)

Implementation

Future<GetAccountListResponse> getAppAccountList(GetAccountListRequest params) async {
  final jsonRequestQuery = params.toJson();
  final url = Uri.parse('${_wepinBaseUrl}account').replace(
    queryParameters: jsonRequestQuery
  );
  final response = await http.get(
    url,
    headers: headers,
  );

  if (response.statusCode >= 200 && response.statusCode < 300) {
    final responseBody = jsonDecode(response.body);
    return GetAccountListResponse.fromJson(responseBody);
  } else {
    throw WepinError(WepinErrorCode.apiRequestError, 'code: ${response.statusCode} , body: ${response.body}');
  }
}