upgrade.m.dart 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. import 'notification.m.dart';
  2. import 'liveConsultation.m.dart';
  3. import 'organization.m.dart';
  4. class GetUpgradeInfoResult {
  5. UpgradeTypeEnum upgradeType;
  6. String? upgradeCDNUrl;
  7. String? upgradeSourceUrl;
  8. String? backUpCDNUrl;
  9. String? backUpSourceUrl;
  10. UpgradeUpdateTypeEnum upgradeUpdateType;
  11. String? newVersion;
  12. String? description;
  13. GetUpgradeInfoResult({
  14. this.upgradeType = UpgradeTypeEnum.NoUpgrade,
  15. this.upgradeCDNUrl,
  16. this.upgradeSourceUrl,
  17. this.backUpCDNUrl,
  18. this.backUpSourceUrl,
  19. this.upgradeUpdateType = UpgradeUpdateTypeEnum.Part,
  20. this.newVersion,
  21. this.description,
  22. });
  23. factory GetUpgradeInfoResult.fromJson(Map<String, dynamic> map) {
  24. return GetUpgradeInfoResult(
  25. upgradeType: UpgradeTypeEnum.values.firstWhere((e) => e.index == map['UpgradeType']),
  26. upgradeCDNUrl: map['UpgradeCDNUrl'],
  27. upgradeSourceUrl: map['UpgradeSourceUrl'],
  28. backUpCDNUrl: map['BackUpCDNUrl'],
  29. backUpSourceUrl: map['BackUpSourceUrl'],
  30. upgradeUpdateType: UpgradeUpdateTypeEnum.values.firstWhere((e) => e.index == map['UpgradeUpdateType']),
  31. newVersion: map['NewVersion'],
  32. description: map['Description'],
  33. );
  34. }
  35. Map<String, dynamic> toJson() {
  36. final map = Map<String, dynamic>();
  37. map['UpgradeType'] = upgradeType.index;
  38. if(upgradeCDNUrl != null)
  39. map['UpgradeCDNUrl'] = upgradeCDNUrl;
  40. if(upgradeSourceUrl != null)
  41. map['UpgradeSourceUrl'] = upgradeSourceUrl;
  42. if(backUpCDNUrl != null)
  43. map['BackUpCDNUrl'] = backUpCDNUrl;
  44. if(backUpSourceUrl != null)
  45. map['BackUpSourceUrl'] = backUpSourceUrl;
  46. map['UpgradeUpdateType'] = upgradeUpdateType.index;
  47. if(newVersion != null)
  48. map['NewVersion'] = newVersion;
  49. if(description != null)
  50. map['Description'] = description;
  51. return map;
  52. }
  53. }
  54. enum UpgradePlatformEnum {
  55. PC,
  56. Android,
  57. IOS,
  58. Mac,
  59. }
  60. enum UpgradeSourceTypeEnum {
  61. Client,
  62. US,
  63. SONOPOST,
  64. FISLib,
  65. }
  66. class GetUpgradeInfoRequest {
  67. UpgradePlatformEnum platform;
  68. UpgradeSourceTypeEnum sourceType;
  69. String? currentVersion;
  70. String? language;
  71. GetUpgradeInfoRequest({
  72. this.platform = UpgradePlatformEnum.PC,
  73. this.sourceType = UpgradeSourceTypeEnum.Client,
  74. this.currentVersion,
  75. this.language,
  76. });
  77. factory GetUpgradeInfoRequest.fromJson(Map<String, dynamic> map) {
  78. return GetUpgradeInfoRequest(
  79. platform: UpgradePlatformEnum.values.firstWhere((e) => e.index == map['Platform']),
  80. sourceType: UpgradeSourceTypeEnum.values.firstWhere((e) => e.index == map['SourceType']),
  81. currentVersion: map['CurrentVersion'],
  82. language: map['Language'],
  83. );
  84. }
  85. Map<String, dynamic> toJson() {
  86. final map = Map<String, dynamic>();
  87. map['Platform'] = platform.index;
  88. map['SourceType'] = sourceType.index;
  89. if(currentVersion != null)
  90. map['CurrentVersion'] = currentVersion;
  91. if(language != null)
  92. map['Language'] = language;
  93. return map;
  94. }
  95. }
  96. class SetUpgradeInfoRequest {
  97. UpgradePlatformEnum platform;
  98. UpgradeSourceTypeEnum sourceType;
  99. String? currentVersion;
  100. String? token;
  101. SetUpgradeInfoRequest({
  102. this.platform = UpgradePlatformEnum.PC,
  103. this.sourceType = UpgradeSourceTypeEnum.Client,
  104. this.currentVersion,
  105. this.token,
  106. });
  107. factory SetUpgradeInfoRequest.fromJson(Map<String, dynamic> map) {
  108. return SetUpgradeInfoRequest(
  109. platform: UpgradePlatformEnum.values.firstWhere((e) => e.index == map['Platform']),
  110. sourceType: UpgradeSourceTypeEnum.values.firstWhere((e) => e.index == map['SourceType']),
  111. currentVersion: map['CurrentVersion'],
  112. token: map['Token'],
  113. );
  114. }
  115. Map<String, dynamic> toJson() {
  116. final map = Map<String, dynamic>();
  117. map['Platform'] = platform.index;
  118. map['SourceType'] = sourceType.index;
  119. if(currentVersion != null)
  120. map['CurrentVersion'] = currentVersion;
  121. if(token != null)
  122. map['Token'] = token;
  123. return map;
  124. }
  125. }
  126. enum OrganizationQueryTypeEnum {
  127. Wait,
  128. Single,
  129. AllDep,
  130. All,
  131. }
  132. class GetUserListRequest extends TokenRequest{
  133. String? keyword;
  134. OrganizationQueryTypeEnum organizationQueryType;
  135. String? organizationCode;
  136. String? rankCode;
  137. String? positionCode;
  138. bool exceptSelf;
  139. String? language;
  140. List<String >? roleCodes;
  141. GetUserListRequest({
  142. this.keyword,
  143. this.organizationQueryType = OrganizationQueryTypeEnum.Wait,
  144. this.organizationCode,
  145. this.rankCode,
  146. this.positionCode,
  147. this.exceptSelf = false,
  148. this.language,
  149. this.roleCodes,
  150. String? token,
  151. }) : super(
  152. token: token,
  153. );
  154. factory GetUserListRequest.fromJson(Map<String, dynamic> map) {
  155. return GetUserListRequest(
  156. keyword: map['Keyword'],
  157. organizationQueryType: OrganizationQueryTypeEnum.values.firstWhere((e) => e.index == map['OrganizationQueryType']),
  158. organizationCode: map['OrganizationCode'],
  159. rankCode: map['RankCode'],
  160. positionCode: map['PositionCode'],
  161. exceptSelf: map['ExceptSelf'],
  162. language: map['Language'],
  163. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  164. token: map['Token'],
  165. );
  166. }
  167. Map<String, dynamic> toJson() {
  168. final map = super.toJson();
  169. if(keyword != null)
  170. map['Keyword'] = keyword;
  171. map['OrganizationQueryType'] = organizationQueryType.index;
  172. if(organizationCode != null)
  173. map['OrganizationCode'] = organizationCode;
  174. if(rankCode != null)
  175. map['RankCode'] = rankCode;
  176. if(positionCode != null)
  177. map['PositionCode'] = positionCode;
  178. map['ExceptSelf'] = exceptSelf;
  179. if(language != null)
  180. map['Language'] = language;
  181. if(roleCodes != null)
  182. map['RoleCodes'] = roleCodes;
  183. return map;
  184. }
  185. }
  186. enum CurrentClientSourceTypeEnum {
  187. PC,
  188. Web,
  189. SONOPOST,
  190. FISLib,
  191. Android,
  192. }
  193. class GetFlyinsonoVersionRequest {
  194. CurrentClientSourceTypeEnum currentClientType;
  195. GetFlyinsonoVersionRequest({
  196. this.currentClientType = CurrentClientSourceTypeEnum.PC,
  197. });
  198. factory GetFlyinsonoVersionRequest.fromJson(Map<String, dynamic> map) {
  199. return GetFlyinsonoVersionRequest(
  200. currentClientType: CurrentClientSourceTypeEnum.values.firstWhere((e) => e.index == map['CurrentClientType']),
  201. );
  202. }
  203. Map<String, dynamic> toJson() {
  204. final map = Map<String, dynamic>();
  205. map['CurrentClientType'] = currentClientType.index;
  206. return map;
  207. }
  208. }