reportApiCallbackEvent method

void reportApiCallbackEvent({
  1. required String moduleName,
  2. String? moduleVersion,
  3. required String apiCallback,
  4. String? params,
  5. String? response,
  6. required int requestId,
  7. int? costTime,
  8. int code = 0,
  9. int time = 0,
  10. bool rightNow = false,
})

上报调用 api 后的异步回调结果

Implementation

void reportApiCallbackEvent(
    {required String moduleName,
    String? moduleVersion,
    required String apiCallback,
    String? params,
    String? response,
    required int requestId,
    int? costTime,
    int code = 0,
    int time = 0,
    bool rightNow = false}) {
  final timestamp = time == 0 ? DateTime.now().millisecond : time;
  final item = {
    keyApiCallback: apiCallback,
    keyEventParams: params,
    keyResponse: response,
    keyEventRequestId: requestId,
    keyCode: code,
    keyTime: timestamp,
    keyCostTime: costTime
  };
  _log(
      'reportApiCallbackEvent=> moduleName:$moduleName,moduleVersion:$moduleVersion,'
      'apiCallback:$apiCallback,params:$params,code:$code,response:$response,'
      'time:$time,rightNow:$rightNow,requestId:$requestId,costTime:$costTime',
      true);
  _report(
      _generateItem(moduleName, _getModuleVersion(moduleName, moduleVersion),
          reportTypeEventApi,
          item: item, timestamp: timestamp),
      rightNow: rightNow);
}