o2_server.dart 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. class O2CloudServer {
  2. String? id; // 标识ID
  3. String? pinyin;
  4. String? pinyinInitial;
  5. String? name; //公司名称
  6. String? centerHost; //对应服务端host 如 dev.platform.tech
  7. String? centerContext; //对应的服务端上下文 如 x_program_center
  8. int? centerPort; //对应的服务器port 如30080
  9. String? httpProtocol; //http协议 http https
  10. String? urlMapping; // 代理地址
  11. O2CloudServer(
  12. {this.id,
  13. this.pinyin,
  14. this.pinyinInitial,
  15. this.name,
  16. this.centerContext,
  17. this.centerHost,
  18. this.centerPort,
  19. this.httpProtocol,
  20. this.urlMapping});
  21. O2CloudServer.fromJson(Map<String, dynamic> jsonMap) {
  22. id = jsonMap['id'];
  23. pinyin = jsonMap['pinyin'];
  24. pinyinInitial = jsonMap['pinyinInitial'];
  25. name = jsonMap['name'];
  26. centerHost = jsonMap['centerHost'];
  27. centerContext = jsonMap['centerContext'];
  28. centerPort = jsonMap['centerPort'];
  29. httpProtocol = jsonMap['httpProtocol'];
  30. urlMapping = jsonMap['urlMapping'];
  31. }
  32. Map<String, dynamic> toJson() => {
  33. "id": id,
  34. "name": name,
  35. "pinyin": pinyin,
  36. "pinyinInitial": pinyinInitial,
  37. "centerHost": centerHost,
  38. "centerContext": centerContext,
  39. "centerPort": centerPort,
  40. "httpProtocol": httpProtocol,
  41. "urlMapping": urlMapping,
  42. };
  43. }