mirror of
https://github.com/foss42/apidash.git
synced 2025-07-03 06:27:26 +08:00
feat: update RequestModel to include default preRequestScript and postRequestScript
This commit is contained in:
@ -22,8 +22,10 @@ class RequestModel with _$RequestModel {
|
|||||||
HttpResponseModel? httpResponseModel,
|
HttpResponseModel? httpResponseModel,
|
||||||
@JsonKey(includeToJson: false) @Default(false) bool isWorking,
|
@JsonKey(includeToJson: false) @Default(false) bool isWorking,
|
||||||
@JsonKey(includeToJson: false) DateTime? sendingTime,
|
@JsonKey(includeToJson: false) DateTime? sendingTime,
|
||||||
@Default("") String preRequestScript,
|
@Default("// Use Javacript to modify this request dynamically")
|
||||||
@Default("") String postRequestScript,
|
String preRequestScript,
|
||||||
|
@Default("// Use Javacript to modify this request dynamically")
|
||||||
|
String postRequestScript,
|
||||||
}) = _RequestModel;
|
}) = _RequestModel;
|
||||||
|
|
||||||
factory RequestModel.fromJson(Map<String, Object?> json) =>
|
factory RequestModel.fromJson(Map<String, Object?> json) =>
|
||||||
|
@ -315,8 +315,10 @@ class _$RequestModelImpl implements _RequestModel {
|
|||||||
this.httpResponseModel,
|
this.httpResponseModel,
|
||||||
@JsonKey(includeToJson: false) this.isWorking = false,
|
@JsonKey(includeToJson: false) this.isWorking = false,
|
||||||
@JsonKey(includeToJson: false) this.sendingTime,
|
@JsonKey(includeToJson: false) this.sendingTime,
|
||||||
this.preRequestScript = "",
|
this.preRequestScript =
|
||||||
this.postRequestScript = ""});
|
"// Use Javacript to modify this request dynamically",
|
||||||
|
this.postRequestScript =
|
||||||
|
"// Use Javacript to modify this request dynamically"});
|
||||||
|
|
||||||
factory _$RequestModelImpl.fromJson(Map<String, dynamic> json) =>
|
factory _$RequestModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||||
_$$RequestModelImplFromJson(json);
|
_$$RequestModelImplFromJson(json);
|
||||||
|
@ -27,8 +27,10 @@ _$RequestModelImpl _$$RequestModelImplFromJson(Map json) => _$RequestModelImpl(
|
|||||||
sendingTime: json['sendingTime'] == null
|
sendingTime: json['sendingTime'] == null
|
||||||
? null
|
? null
|
||||||
: DateTime.parse(json['sendingTime'] as String),
|
: DateTime.parse(json['sendingTime'] as String),
|
||||||
preRequestScript: json['preRequestScript'] as String? ?? "",
|
preRequestScript: json['preRequestScript'] as String? ??
|
||||||
postRequestScript: json['postRequestScript'] as String? ?? "",
|
"// Use Javacript to modify this request dynamically",
|
||||||
|
postRequestScript: json['postRequestScript'] as String? ??
|
||||||
|
"// Use Javacript to modify this request dynamically",
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$$RequestModelImplToJson(_$RequestModelImpl instance) =>
|
Map<String, dynamic> _$$RequestModelImplToJson(_$RequestModelImpl instance) =>
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import 'dart:nativewrappers/_internal/vm/lib/ffi_allocation_patch.dart';
|
|
||||||
|
|
||||||
import 'package:apidash_core/apidash_core.dart';
|
import 'package:apidash_core/apidash_core.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import '../models/models.dart';
|
import '../models/models.dart';
|
||||||
|
Reference in New Issue
Block a user