toJson method

dynamic toJson()

转换成JSON,补充部分字段

Implementation

dynamic toJson() async {
  return {
    "instanceId": '$instanceId',
    "app": appId,
    "ipAddr": ipAddr,
    'vipAddress': appId,
    'secureVipAddress': appId,
    "homePageUrl": contextPath ?? '/',
    "statusPageUrl": null,
    "healthCheckUrl": null,
    "secureHealthCheckUrl": null,
    "countryId": 1,
    "dataCenterInfo": {
      'name': 'MyOwn',
      '@class': 'com.netflix.appinfo.InstanceInfo\$DefaultDataCenterInfo'
    },
    "hostName": '${Platform.localHostname}',
    "status": status,
    "leaseInfo": null,
    "overridden_status": "UNKNOWN",
    "metadata": {'management.port': port},
    'port': {'\$': port, "@enabled": "true"}
  };
}