vitalTeam.m.dart 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. import 'liveConsultation.m.dart';
  2. import 'notification.m.dart';
  3. import 'device.m.dart';
  4. class CreateTeamRequest extends TokenRequest{
  5. String? code;
  6. String? teamName;
  7. String? description;
  8. String? organizationCode;
  9. List<String>? members;
  10. String? principal;
  11. CreateTeamRequest({
  12. this.code,
  13. this.teamName,
  14. this.description,
  15. this.organizationCode,
  16. this.members,
  17. this.principal,
  18. String? token,
  19. }) : super(
  20. token: token,
  21. );
  22. factory CreateTeamRequest.fromJson(Map<String, dynamic> map) {
  23. return CreateTeamRequest(
  24. code: map['Code'],
  25. teamName: map['TeamName'],
  26. description: map['Description'],
  27. organizationCode: map['OrganizationCode'],
  28. members: map['Members']?.cast<String>().toList(),
  29. principal: map['Principal'],
  30. token: map['Token'],
  31. );
  32. }
  33. Map<String, dynamic> toJson() {
  34. final map = super.toJson();
  35. if (code != null)
  36. map['Code'] = code;
  37. if (teamName != null)
  38. map['TeamName'] = teamName;
  39. if (description != null)
  40. map['Description'] = description;
  41. if (organizationCode != null)
  42. map['OrganizationCode'] = organizationCode;
  43. if (members != null)
  44. map['Members'] = members;
  45. if (principal != null)
  46. map['Principal'] = principal;
  47. return map;
  48. }
  49. }
  50. class TeamDTO extends BaseDTO{
  51. String? code;
  52. String? teamName;
  53. String? description;
  54. String? organizationCode;
  55. List<String>? members;
  56. String? principal;
  57. String? principalName;
  58. TeamDTO({
  59. this.code,
  60. this.teamName,
  61. this.description,
  62. this.organizationCode,
  63. this.members,
  64. this.principal,
  65. this.principalName,
  66. DateTime? createTime,
  67. DateTime? updateTime,
  68. }) : super(
  69. createTime: createTime,
  70. updateTime: updateTime,
  71. );
  72. factory TeamDTO.fromJson(Map<String, dynamic> map) {
  73. return TeamDTO(
  74. code: map['Code'],
  75. teamName: map['TeamName'],
  76. description: map['Description'],
  77. organizationCode: map['OrganizationCode'],
  78. members: map['Members']?.cast<String>().toList(),
  79. principal: map['Principal'],
  80. principalName: map['PrincipalName'],
  81. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  82. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  83. );
  84. }
  85. Map<String, dynamic> toJson() {
  86. final map = super.toJson();
  87. if (code != null)
  88. map['Code'] = code;
  89. if (teamName != null)
  90. map['TeamName'] = teamName;
  91. if (description != null)
  92. map['Description'] = description;
  93. if (organizationCode != null)
  94. map['OrganizationCode'] = organizationCode;
  95. if (members != null)
  96. map['Members'] = members;
  97. if (principal != null)
  98. map['Principal'] = principal;
  99. if (principalName != null)
  100. map['PrincipalName'] = principalName;
  101. return map;
  102. }
  103. }
  104. class GetTeamRequest extends TokenRequest{
  105. String? code;
  106. GetTeamRequest({
  107. this.code,
  108. String? token,
  109. }) : super(
  110. token: token,
  111. );
  112. factory GetTeamRequest.fromJson(Map<String, dynamic> map) {
  113. return GetTeamRequest(
  114. code: map['Code'],
  115. token: map['Token'],
  116. );
  117. }
  118. Map<String, dynamic> toJson() {
  119. final map = super.toJson();
  120. if (code != null)
  121. map['Code'] = code;
  122. return map;
  123. }
  124. }
  125. class GetTeamByKeyRequest extends TokenRequest{
  126. String? key;
  127. String? value;
  128. GetTeamByKeyRequest({
  129. this.key,
  130. this.value,
  131. String? token,
  132. }) : super(
  133. token: token,
  134. );
  135. factory GetTeamByKeyRequest.fromJson(Map<String, dynamic> map) {
  136. return GetTeamByKeyRequest(
  137. key: map['Key'],
  138. value: map['Value'],
  139. token: map['Token'],
  140. );
  141. }
  142. Map<String, dynamic> toJson() {
  143. final map = super.toJson();
  144. if (key != null)
  145. map['Key'] = key;
  146. if (value != null)
  147. map['Value'] = value;
  148. return map;
  149. }
  150. }
  151. class TeamPageRequest extends PageRequest{
  152. TeamPageRequest({
  153. int pageIndex = 0,
  154. int pageSize = 0,
  155. String? token,
  156. }) : super(
  157. pageIndex: pageIndex,
  158. pageSize: pageSize,
  159. token: token,
  160. );
  161. factory TeamPageRequest.fromJson(Map<String, dynamic> map) {
  162. return TeamPageRequest(
  163. pageIndex: map['PageIndex'],
  164. pageSize: map['PageSize'],
  165. token: map['Token'],
  166. );
  167. }
  168. Map<String, dynamic> toJson() {
  169. final map = super.toJson();
  170. return map;
  171. }
  172. }
  173. class RemoveTeamRequest extends TokenRequest{
  174. String? code;
  175. RemoveTeamRequest({
  176. this.code,
  177. String? token,
  178. }) : super(
  179. token: token,
  180. );
  181. factory RemoveTeamRequest.fromJson(Map<String, dynamic> map) {
  182. return RemoveTeamRequest(
  183. code: map['Code'],
  184. token: map['Token'],
  185. );
  186. }
  187. Map<String, dynamic> toJson() {
  188. final map = super.toJson();
  189. if (code != null)
  190. map['Code'] = code;
  191. return map;
  192. }
  193. }
  194. class GetTeamListRequest extends TokenRequest{
  195. List<String>? codes;
  196. GetTeamListRequest({
  197. this.codes,
  198. String? token,
  199. }) : super(
  200. token: token,
  201. );
  202. factory GetTeamListRequest.fromJson(Map<String, dynamic> map) {
  203. return GetTeamListRequest(
  204. codes: map['Codes']?.cast<String>().toList(),
  205. token: map['Token'],
  206. );
  207. }
  208. Map<String, dynamic> toJson() {
  209. final map = super.toJson();
  210. if (codes != null)
  211. map['Codes'] = codes;
  212. return map;
  213. }
  214. }
  215. class UpdateTeamRequest extends TokenRequest{
  216. String? code;
  217. String? teamName;
  218. String? description;
  219. String? organizationCode;
  220. List<String>? members;
  221. String? principal;
  222. UpdateTeamRequest({
  223. this.code,
  224. this.teamName,
  225. this.description,
  226. this.organizationCode,
  227. this.members,
  228. this.principal,
  229. String? token,
  230. }) : super(
  231. token: token,
  232. );
  233. factory UpdateTeamRequest.fromJson(Map<String, dynamic> map) {
  234. return UpdateTeamRequest(
  235. code: map['Code'],
  236. teamName: map['TeamName'],
  237. description: map['Description'],
  238. organizationCode: map['OrganizationCode'],
  239. members: map['Members']?.cast<String>().toList(),
  240. principal: map['Principal'],
  241. token: map['Token'],
  242. );
  243. }
  244. Map<String, dynamic> toJson() {
  245. final map = super.toJson();
  246. if (code != null)
  247. map['Code'] = code;
  248. if (teamName != null)
  249. map['TeamName'] = teamName;
  250. if (description != null)
  251. map['Description'] = description;
  252. if (organizationCode != null)
  253. map['OrganizationCode'] = organizationCode;
  254. if (members != null)
  255. map['Members'] = members;
  256. if (principal != null)
  257. map['Principal'] = principal;
  258. return map;
  259. }
  260. }
  261. class JoinTeamRequest extends TokenRequest{
  262. List<String>? userCodes;
  263. String? teamCode;
  264. JoinTeamRequest({
  265. this.userCodes,
  266. this.teamCode,
  267. String? token,
  268. }) : super(
  269. token: token,
  270. );
  271. factory JoinTeamRequest.fromJson(Map<String, dynamic> map) {
  272. return JoinTeamRequest(
  273. userCodes: map['UserCodes']?.cast<String>().toList(),
  274. teamCode: map['TeamCode'],
  275. token: map['Token'],
  276. );
  277. }
  278. Map<String, dynamic> toJson() {
  279. final map = super.toJson();
  280. if (userCodes != null)
  281. map['UserCodes'] = userCodes;
  282. if (teamCode != null)
  283. map['TeamCode'] = teamCode;
  284. return map;
  285. }
  286. }
  287. class QuitTeamRequest extends TokenRequest{
  288. List<String>? userCodes;
  289. String? teamCode;
  290. QuitTeamRequest({
  291. this.userCodes,
  292. this.teamCode,
  293. String? token,
  294. }) : super(
  295. token: token,
  296. );
  297. factory QuitTeamRequest.fromJson(Map<String, dynamic> map) {
  298. return QuitTeamRequest(
  299. userCodes: map['UserCodes']?.cast<String>().toList(),
  300. teamCode: map['TeamCode'],
  301. token: map['Token'],
  302. );
  303. }
  304. Map<String, dynamic> toJson() {
  305. final map = super.toJson();
  306. if (userCodes != null)
  307. map['UserCodes'] = userCodes;
  308. if (teamCode != null)
  309. map['TeamCode'] = teamCode;
  310. return map;
  311. }
  312. }
  313. class GetTeamPageByOrganizationRequest extends PageRequest{
  314. String? organizationCode;
  315. GetTeamPageByOrganizationRequest({
  316. this.organizationCode,
  317. int pageIndex = 0,
  318. int pageSize = 0,
  319. String? token,
  320. }) : super(
  321. pageIndex: pageIndex,
  322. pageSize: pageSize,
  323. token: token,
  324. );
  325. factory GetTeamPageByOrganizationRequest.fromJson(Map<String, dynamic> map) {
  326. return GetTeamPageByOrganizationRequest(
  327. organizationCode: map['OrganizationCode'],
  328. pageIndex: map['PageIndex'],
  329. pageSize: map['PageSize'],
  330. token: map['Token'],
  331. );
  332. }
  333. Map<String, dynamic> toJson() {
  334. final map = super.toJson();
  335. if (organizationCode != null)
  336. map['OrganizationCode'] = organizationCode;
  337. return map;
  338. }
  339. }
  340. class SetTeamPrincipalRequest extends TokenRequest{
  341. String? teamCode;
  342. String? principal;
  343. SetTeamPrincipalRequest({
  344. this.teamCode,
  345. this.principal,
  346. String? token,
  347. }) : super(
  348. token: token,
  349. );
  350. factory SetTeamPrincipalRequest.fromJson(Map<String, dynamic> map) {
  351. return SetTeamPrincipalRequest(
  352. teamCode: map['TeamCode'],
  353. principal: map['Principal'],
  354. token: map['Token'],
  355. );
  356. }
  357. Map<String, dynamic> toJson() {
  358. final map = super.toJson();
  359. if (teamCode != null)
  360. map['TeamCode'] = teamCode;
  361. if (principal != null)
  362. map['Principal'] = principal;
  363. return map;
  364. }
  365. }