formatResponse static method

String formatResponse(
  1. Map<String, dynamic> result
)

Implementation

static String formatResponse(Map<String,dynamic> result) {
  try {
    return jsonEncode(SmartHomeBaseResponse.fromJson(result).toJson());
  } catch (e) {
    return jsonEncode({
      "errorMsg": "失败",
      "message": "数据解析异常",
      "errorCode": 500,
      "data": null,
    });
  }
}