
class BaseEntity {
  int? code;
  int? result;
  String? msg;
  dynamic data;

  // 构造函数
  BaseEntity({this.code, this.result, this.msg, this.data});

  // 数据解析
  factory BaseEntity.fromJson(json) {
    dynamic data = json["content"][0]["text"];
    return BaseEntity(code: 0,data: data);
  }


  // 数据解析
  factory BaseEntity.PlayfromComfyUi(json) {
    Map<String, dynamic> responseData = json;
    String message = responseData["type"]; //错误描述
    dynamic data = responseData["name"];
    return BaseEntity(code: 0, result: 0, msg: message, data: data);
  }

  // 数据解析
  factory BaseEntity.PlayfromJson(json) {
    Map<String, dynamic> responseData = json;
    int code = responseData["code"];
    // int result = responseData["Result"];
    String message = responseData["msg"]; //错误描述
    dynamic data = responseData["data"];
    return BaseEntity(code: code, result: 0, msg: message, data: data);
  }
}

class ErrorEntity {
  int? code;
  String? msg;

  ErrorEntity({this.code, this.msg});
}
