gzkj_response.dart 784 B

123456789101112131415161718192021222324252627282930
  1. import 'package:json_annotation/json_annotation.dart';
  2. part 'gzkj_response.g.dart';
  3. ///国中康健响应
  4. @JsonSerializable(genericArgumentFactories: true)
  5. class GzkjResponse<T> {
  6. @JsonKey(name: "success")
  7. final bool? success;
  8. @JsonKey(name: "messagecode")
  9. final String? messagecode;
  10. @JsonKey(name: "message")
  11. final String? message;
  12. @JsonKey(name: "data")
  13. T? data;
  14. GzkjResponse({this.success, this.messagecode, this.message, this.data});
  15. factory GzkjResponse.fromJson(
  16. Map<String, dynamic> json, T Function(Object? json) fromJsonT) {
  17. return _$GzkjResponseFromJson(json, fromJsonT);
  18. }
  19. Map<String, dynamic> toJson(Object Function(T value) toJsonT) {
  20. return _$GzkjResponseToJson(this, toJsonT);
  21. }
  22. bool get isSuccess => success ?? false;
  23. }