import 'package:dio/dio.dart';

class ResponseInterceptor extends Interceptor {
  @override
  void onResponse(Response response, ResponseInterceptorHandler handler) {
    final uuid = response.requestOptions.extra['uuid'] as String? ?? '';

    _printResponseLog(response, uuid);

    handler.next(response);
  }

  void _printResponseLog(Response response, String uuid) {
    print('========== Response START ==========');
    print('UUID: $uuid');
    print('Status Code: ${response.statusCode}');
    print('Data: ${response.data}');
    print('========== Response END ==========');
  }
}