import 'package:flutter_clx_base/flutter_clx_base.dart';

class NetConfig {
  String baseUrl = '';
  final List<Interceptor> requestInterceptors = <Interceptor>[];
  final List<ErrorHandleIntercept> errorHandleIntercepts =
      <ErrorHandleIntercept>[];
  NetConfig.init({
    this.baseUrl = '',
    List<Interceptor>? interceptors,
    List<ErrorHandleIntercept> errorHandleIntercepts = const [],
  }) {
    requestInterceptors.clear();
    requestInterceptors.addAll(interceptors ?? []);
    this.errorHandleIntercepts.addAll(errorHandleIntercepts);
  }
}

class ErrorHandleIntercept {
  int? errCode;
  void Function()? errCallback;
}
