Logo white

GitLab

liangchengyou / wow_english

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • wow_english
  • lib
  • common
  • request
  • api_response
  • api_response_entity.dart
  • feat: api
    056970d8
    Key authored
    2023-06-20 19:52:43 +0800  
    Browse Code ยป
api_response_entity.dart 367 Bytes
Edit Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
import 'dart:convert';

import 'api_response_entity.g.dart';

class ApiResponse<T> {
  int? code;
  String? msg;
  T? data;

  ApiResponse();

  factory ApiResponse.fromJson(Map<String, dynamic> json) => $ApiResponseFromJson<T>(json);

  Map<String, dynamic> toJson() => $ApiResponseToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}