o2_center_server.dart 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. import 'package:o2oa_all_platform/common/values/o2.dart';
  2. /// o2oa 服务器信息
  3. class CenterServerInfo {
  4. ModuleAssembles? assembles;
  5. WebServerInfo? webServer;
  6. String? tokenName; // tokenName是可修改的 x-token是默认值
  7. MockConfig? mockConfig; // put delete 代理
  8. bool? standalone; // 是否统一端口服务器
  9. CenterServerInfo.fromJson(Map<String, dynamic> jsonMap) {
  10. if (jsonMap['webServer'] != null) {
  11. webServer = WebServerInfo.fromJson(jsonMap['webServer']);
  12. }
  13. if (jsonMap['assembles'] != null) {
  14. assembles = ModuleAssembles.fromJson(jsonMap['assembles']);
  15. }
  16. if (jsonMap['tokenName'] != null) {
  17. tokenName = jsonMap['tokenName'];
  18. } else {
  19. tokenName = O2.defaultTokenName;
  20. }
  21. if (jsonMap['mockConfig'] != null) {
  22. mockConfig = MockConfig.fromJson(jsonMap['mockConfig']);
  23. }
  24. standalone = jsonMap['standalone'];
  25. }
  26. Map<String, dynamic> toJson() => {
  27. "webServer": webServer?.toJson(),
  28. "assembles": assembles?.toJson(),
  29. "tokenName": tokenName,
  30. "mockConfig": mockConfig?.toJson(),
  31. "standalone": standalone
  32. };
  33. }
  34. ///
  35. ///"mockConfig": {
  36. // "mock": {
  37. // "x_processplatform_assemble_surface": {
  38. // "put": {
  39. // "to": "post",
  40. // "append": "mockputtopost"
  41. // },
  42. // "delete": {
  43. // "to": "get",
  44. // "append": "mockdeletetoget"
  45. // }
  46. // },
  47. // "x_cms_assemble_control": {
  48. // "put": {
  49. // "to": "post",
  50. // "append": "mockputtopost"
  51. // },
  52. // "delete": {
  53. // "to": "get",
  54. // "append": "mockdeletetoget"
  55. // }
  56. // },
  57. // "x_query_assemble_surface": {
  58. // "put": {
  59. // "to": "post",
  60. // "append": "mockputtopost"
  61. // },
  62. // "delete": {
  63. // "to": "get",
  64. // "append": "mockdeletetoget"
  65. // }
  66. // },
  67. // "x_organization_assemble_authentication": {
  68. // "put": {
  69. // "to": "post",
  70. // "append": "mockputtopost"
  71. // },
  72. // "delete": {
  73. // "to": "get",
  74. // "append": "mockdeletetoget"
  75. // }
  76. // },
  77. // "x_organization_assemble_personal": {
  78. // "put": {
  79. // "to": "post",
  80. // "append": "mockputtopost"
  81. // },
  82. // "delete": {
  83. // "to": "get",
  84. // "append": "mockdeletetoget"
  85. // }
  86. // }
  87. // }
  88. // }
  89. ///
  90. class MockConfig {
  91. Map<String, dynamic>? mock;
  92. MockConfig.fromJson(Map<String, dynamic> jsonMap) {
  93. mock = jsonMap['mock'];
  94. }
  95. Map<String, dynamic> toJson() => {"mock": mock};
  96. }
  97. class MockMode {
  98. String? to; // 转化后的方法
  99. String? append; // 需要添加的url
  100. MockMode.fromJson(Map<String, dynamic> jsonMap) {
  101. to = jsonMap['to'];
  102. append = jsonMap['append'];
  103. }
  104. Map<String, dynamic> toJson() => {"to": to, "append": append};
  105. }
  106. /// web 服务模块
  107. class WebServerInfo {
  108. String? host;
  109. int? port;
  110. String? proxyHost;
  111. int? proxyPort;
  112. String? username;
  113. String? password;
  114. int? order;
  115. String? name;
  116. bool? sslEnable;
  117. WebServerInfo.fromJson(Map<String, dynamic> jsonMap) {
  118. host = jsonMap['host'];
  119. port = jsonMap['port'];
  120. proxyHost = jsonMap['proxyHost'];
  121. proxyPort = jsonMap['proxyPort'];
  122. username = jsonMap['username'];
  123. password = jsonMap['password'];
  124. order = jsonMap['order'];
  125. name = jsonMap['name'];
  126. sslEnable = jsonMap['sslEnable'] ?? false;
  127. }
  128. Map<String, dynamic> toJson() => {
  129. "host": host,
  130. "port": port,
  131. "proxyHost": proxyHost,
  132. "proxyPort": proxyPort,
  133. "username": username,
  134. "password": password,
  135. "order": order,
  136. "name": name,
  137. "sslEnable": sslEnable
  138. };
  139. }
  140. /// 应用服务模块
  141. class ModuleServerInfo {
  142. String? host;
  143. int? port;
  144. String? proxyHost;
  145. int? proxyPort;
  146. String? context;
  147. ModuleServerInfo.fromJson(Map<String, dynamic> jsonMap) {
  148. if (jsonMap['host'] != null) {
  149. host = jsonMap['host'];
  150. }
  151. if (jsonMap['port'] != null) {
  152. port = jsonMap['port'];
  153. }
  154. if (jsonMap['proxyHost'] != null) {
  155. proxyHost = jsonMap['proxyHost'];
  156. }
  157. if (jsonMap['proxyPort'] != null) {
  158. proxyPort = jsonMap['proxyPort'];
  159. }
  160. if (jsonMap['context'] != null) {
  161. context = jsonMap['context'];
  162. }
  163. }
  164. Map<String, dynamic> toJson() => {
  165. "host": host,
  166. "port": port,
  167. "proxyHost": proxyHost,
  168. "proxyPort": proxyPort,
  169. "context": context
  170. };
  171. }
  172. class ModuleAssembles {
  173. ModuleServerInfo? x_file_assemble_control;
  174. ModuleServerInfo? x_bbs_assemble_control;
  175. ModuleServerInfo? x_hotpic_assemble_control;
  176. ModuleServerInfo? x_attendance_assemble_control;
  177. ModuleServerInfo? x_meeting_assemble_control;
  178. ModuleServerInfo? x_processplatform_service_processing;
  179. ModuleServerInfo? x_cms_assemble_control;
  180. ModuleServerInfo? x_organization_assemble_control;
  181. ModuleServerInfo? x_organization_assemble_custom;
  182. ModuleServerInfo? x_processplatform_assemble_surface;
  183. ModuleServerInfo? x_processplatform_assemble_bam;
  184. ModuleServerInfo? x_organization_assemble_express;
  185. ModuleServerInfo? x_organization_assemble_personal;
  186. ModuleServerInfo? x_component_assemble_control;
  187. ModuleServerInfo? x_processplatform_assemble_designer;
  188. ModuleServerInfo? x_organization_assemble_authentication;
  189. ModuleServerInfo? x_portal_assemble_surface;
  190. ModuleServerInfo? x_calendar_assemble_control; //日程
  191. ModuleServerInfo? x_mind_assemble_control; //脑图
  192. ModuleServerInfo? x_teamwork_assemble_control; //TeamWork
  193. ModuleServerInfo? x_wcrm_assemble_control; // crm
  194. ModuleServerInfo? x_jpush_assemble_control; //极光推送服务
  195. ModuleServerInfo? x_message_assemble_communicate; //通信模块 消息收发 还有websocket
  196. ModuleServerInfo? x_organizationPermission; // custom模块 通讯录 需要到应用市场下载安装
  197. ModuleServerInfo? x_pan_assemble_control; // custom模块 V3版本云盘服务 需要到应用市场下载安装
  198. ModuleServerInfo? x_query_assemble_surface;
  199. ModuleServerInfo? x_app_packaging_client_assemble_control;
  200. ModuleAssembles.fromJson(Map<String, dynamic> jsonMap) {
  201. if (jsonMap['x_jpush_assemble_control'] != null) {
  202. x_jpush_assemble_control =
  203. ModuleServerInfo.fromJson(jsonMap['x_jpush_assemble_control']);
  204. }
  205. if (jsonMap['x_message_assemble_communicate'] != null) {
  206. x_message_assemble_communicate =
  207. ModuleServerInfo.fromJson(jsonMap['x_message_assemble_communicate']);
  208. }
  209. if (jsonMap['x_pan_assemble_control'] != null) {
  210. x_pan_assemble_control =
  211. ModuleServerInfo.fromJson(jsonMap['x_pan_assemble_control']);
  212. }
  213. if (jsonMap['x_organizationPermission'] != null) {
  214. x_organizationPermission =
  215. ModuleServerInfo.fromJson(jsonMap['x_organizationPermission']);
  216. }
  217. if (jsonMap['x_wcrm_assemble_control'] != null) {
  218. x_wcrm_assemble_control =
  219. ModuleServerInfo.fromJson(jsonMap['x_wcrm_assemble_control']);
  220. }
  221. if (jsonMap['x_file_assemble_control'] != null) {
  222. x_file_assemble_control =
  223. ModuleServerInfo.fromJson(jsonMap['x_file_assemble_control']);
  224. }
  225. if (jsonMap['x_bbs_assemble_control'] != null) {
  226. x_bbs_assemble_control =
  227. ModuleServerInfo.fromJson(jsonMap['x_bbs_assemble_control']);
  228. }
  229. if (jsonMap['x_hotpic_assemble_control'] != null) {
  230. x_hotpic_assemble_control =
  231. ModuleServerInfo.fromJson(jsonMap['x_hotpic_assemble_control']);
  232. }
  233. if (jsonMap['x_attendance_assemble_control'] != null) {
  234. x_attendance_assemble_control =
  235. ModuleServerInfo.fromJson(jsonMap['x_attendance_assemble_control']);
  236. }
  237. if (jsonMap['x_meeting_assemble_control'] != null) {
  238. x_meeting_assemble_control =
  239. ModuleServerInfo.fromJson(jsonMap['x_meeting_assemble_control']);
  240. }
  241. if (jsonMap['x_cms_assemble_control'] != null) {
  242. x_cms_assemble_control =
  243. ModuleServerInfo.fromJson(jsonMap['x_cms_assemble_control']);
  244. }
  245. if (jsonMap['x_organization_assemble_control'] != null) {
  246. x_organization_assemble_control =
  247. ModuleServerInfo.fromJson(jsonMap['x_organization_assemble_control']);
  248. }
  249. if (jsonMap['x_organization_assemble_custom'] != null) {
  250. x_organization_assemble_custom =
  251. ModuleServerInfo.fromJson(jsonMap['x_organization_assemble_custom']);
  252. }
  253. if (jsonMap['x_processplatform_assemble_surface'] != null) {
  254. x_processplatform_assemble_surface = ModuleServerInfo.fromJson(
  255. jsonMap['x_processplatform_assemble_surface']);
  256. }
  257. if (jsonMap['x_organization_assemble_express'] != null) {
  258. x_organization_assemble_express =
  259. ModuleServerInfo.fromJson(jsonMap['x_organization_assemble_express']);
  260. }
  261. if (jsonMap['x_organization_assemble_personal'] != null) {
  262. x_organization_assemble_personal = ModuleServerInfo.fromJson(
  263. jsonMap['x_organization_assemble_personal']);
  264. }
  265. if (jsonMap['x_component_assemble_control'] != null) {
  266. x_component_assemble_control =
  267. ModuleServerInfo.fromJson(jsonMap['x_component_assemble_control']);
  268. }
  269. if (jsonMap['x_processplatform_service_processing'] != null) {
  270. x_processplatform_service_processing = ModuleServerInfo.fromJson(
  271. jsonMap['x_processplatform_service_processing']);
  272. }
  273. if (jsonMap['x_processplatform_assemble_designer'] != null) {
  274. x_processplatform_assemble_designer = ModuleServerInfo.fromJson(
  275. jsonMap['x_processplatform_assemble_designer']);
  276. }
  277. if (jsonMap['x_processplatform_assemble_bam'] != null) {
  278. x_processplatform_assemble_bam =
  279. ModuleServerInfo.fromJson(jsonMap['x_processplatform_assemble_bam']);
  280. }
  281. if (jsonMap['x_organization_assemble_authentication'] != null) {
  282. x_organization_assemble_authentication = ModuleServerInfo.fromJson(
  283. jsonMap['x_organization_assemble_authentication']);
  284. }
  285. if (jsonMap['x_portal_assemble_surface'] != null) {
  286. x_portal_assemble_surface =
  287. ModuleServerInfo.fromJson(jsonMap['x_portal_assemble_surface']);
  288. }
  289. if (jsonMap['x_calendar_assemble_control'] != null) {
  290. x_calendar_assemble_control =
  291. ModuleServerInfo.fromJson(jsonMap['x_calendar_assemble_control']);
  292. }
  293. if (jsonMap['x_mind_assemble_control'] != null) {
  294. x_mind_assemble_control =
  295. ModuleServerInfo.fromJson(jsonMap['x_mind_assemble_control']);
  296. }
  297. if (jsonMap['x_teamwork_assemble_control'] != null) {
  298. x_teamwork_assemble_control =
  299. ModuleServerInfo.fromJson(jsonMap['x_teamwork_assemble_control']);
  300. }
  301. if (jsonMap['x_query_assemble_surface'] != null) {
  302. x_query_assemble_surface =
  303. ModuleServerInfo.fromJson(jsonMap['x_query_assemble_surface']);
  304. }
  305. if (jsonMap['x_app_packaging_client_assemble_control'] != null) {
  306. x_app_packaging_client_assemble_control =
  307. ModuleServerInfo.fromJson(jsonMap['x_app_packaging_client_assemble_control']);
  308. }
  309. }
  310. Map<String, dynamic> toJson() => {
  311. "x_file_assemble_control": x_file_assemble_control?.toJson(),
  312. "x_bbs_assemble_control": x_bbs_assemble_control?.toJson(),
  313. "x_hotpic_assemble_control": x_hotpic_assemble_control?.toJson(),
  314. "x_attendance_assemble_control":
  315. x_attendance_assemble_control?.toJson(),
  316. "x_meeting_assemble_control": x_meeting_assemble_control?.toJson(),
  317. "x_processplatform_assemble_bam":
  318. x_processplatform_assemble_bam?.toJson(),
  319. "x_cms_assemble_control": x_cms_assemble_control?.toJson(),
  320. "x_organization_assemble_control":
  321. x_organization_assemble_control?.toJson(),
  322. "x_organization_assemble_custom":
  323. x_organization_assemble_custom?.toJson(),
  324. "x_processplatform_assemble_surface":
  325. x_processplatform_assemble_surface?.toJson(),
  326. "x_processplatform_service_processing":
  327. x_processplatform_service_processing?.toJson(),
  328. "x_organization_assemble_express":
  329. x_organization_assemble_express?.toJson(),
  330. "x_organization_assemble_personal":
  331. x_organization_assemble_personal?.toJson(),
  332. "x_component_assemble_control": x_component_assemble_control?.toJson(),
  333. "x_processplatform_assemble_designer":
  334. x_processplatform_assemble_designer?.toJson(),
  335. "x_organization_assemble_authentication":
  336. x_organization_assemble_authentication?.toJson(),
  337. "x_portal_assemble_surface": x_portal_assemble_surface?.toJson(),
  338. "x_calendar_assemble_control": x_calendar_assemble_control?.toJson(),
  339. "x_mind_assemble_control": x_mind_assemble_control?.toJson(),
  340. "x_teamwork_assemble_control": x_teamwork_assemble_control?.toJson(),
  341. "x_wcrm_assemble_control": x_wcrm_assemble_control?.toJson(),
  342. "x_jpush_assemble_control": x_jpush_assemble_control?.toJson(),
  343. "x_message_assemble_communicate":
  344. x_message_assemble_communicate?.toJson(),
  345. "x_organizationPermission": x_organizationPermission?.toJson(),
  346. "x_pan_assemble_control": x_pan_assemble_control?.toJson(),
  347. "x_query_assemble_surface": x_query_assemble_surface?.toJson(),
  348. "x_app_packaging_client_assemble_control": x_app_packaging_client_assemble_control?.toJson(),
  349. };
  350. }