login.m.dart 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. class UserTokenDTO {
  2. String? userCode;
  3. String? deviceId;
  4. String? token;
  5. UserTokenDTO({
  6. this.userCode,
  7. this.deviceId,
  8. this.token,
  9. });
  10. factory UserTokenDTO.fromJson(Map<String, dynamic> map) {
  11. return UserTokenDTO(
  12. userCode: map['UserCode'],
  13. deviceId: map['DeviceId'],
  14. token: map['Token'],
  15. );
  16. }
  17. Map<String, dynamic> toJson() {
  18. final map = Map<String, dynamic>();
  19. if(userCode != null)
  20. map['UserCode'] = userCode;
  21. if(deviceId != null)
  22. map['DeviceId'] = deviceId;
  23. if(token != null)
  24. map['Token'] = token;
  25. return map;
  26. }
  27. }
  28. class BaseParamsString {
  29. int length;
  30. BaseParamsString({
  31. this.length = 0,
  32. });
  33. factory BaseParamsString.fromJson(Map<String, dynamic> map) {
  34. return BaseParamsString(
  35. length: map['Length'],
  36. );
  37. }
  38. Map<String, dynamic> toJson() {
  39. final map = Map<String, dynamic>();
  40. map['Length'] = length;
  41. return map;
  42. }
  43. }
  44. class AccountString extends BaseParamsString{
  45. AccountString({
  46. int length = 0,
  47. }) : super(
  48. length: length,
  49. );
  50. factory AccountString.fromJson(Map<String, dynamic> map) {
  51. return AccountString(
  52. length: map['Length'],
  53. );
  54. }
  55. Map<String, dynamic> toJson() {
  56. final map = super.toJson();
  57. return map;
  58. }
  59. }
  60. class VerificationCode extends BaseParamsString{
  61. VerificationCode({
  62. int length = 0,
  63. }) : super(
  64. length: length,
  65. );
  66. factory VerificationCode.fromJson(Map<String, dynamic> map) {
  67. return VerificationCode(
  68. length: map['Length'],
  69. );
  70. }
  71. Map<String, dynamic> toJson() {
  72. final map = super.toJson();
  73. return map;
  74. }
  75. }
  76. class PasswordString extends BaseParamsString{
  77. int length;
  78. PasswordString({
  79. this.length = 0,
  80. });
  81. factory PasswordString.fromJson(Map<String, dynamic> map) {
  82. return PasswordString(
  83. length: map['Length'],
  84. );
  85. }
  86. Map<String, dynamic> toJson() {
  87. final map = super.toJson();
  88. return map;
  89. }
  90. }
  91. class CommonLoginRequest {
  92. AccountString? anyAccount;
  93. VerificationCode? anyCode;
  94. PasswordString? password;
  95. Map<String,String>? headerMap;
  96. CommonLoginRequest({
  97. this.anyAccount,
  98. this.anyCode,
  99. this.password,
  100. this.headerMap,
  101. });
  102. factory CommonLoginRequest.fromJson(Map<String, dynamic> map) {
  103. return CommonLoginRequest(
  104. anyAccount: map['AnyAccount'],
  105. anyCode: map['AnyCode'],
  106. password: map['Password'],
  107. headerMap: map['HeaderMap'] != null ? map['HeaderMap'].cast<String,String>() : null,
  108. );
  109. }
  110. Map<String, dynamic> toJson() {
  111. final map = Map<String, dynamic>();
  112. if(anyAccount != null)
  113. map['AnyAccount'] = anyAccount;
  114. if(anyCode != null)
  115. map['AnyCode'] = anyCode;
  116. if(password != null)
  117. map['Password'] = password;
  118. if(headerMap != null)
  119. map['HeaderMap'] = headerMap;
  120. return map;
  121. }
  122. }
  123. class CheckLoginTypeRequest {
  124. AccountString? anyAccount;
  125. CheckLoginTypeRequest({
  126. this.anyAccount,
  127. });
  128. factory CheckLoginTypeRequest.fromJson(Map<String, dynamic> map) {
  129. return CheckLoginTypeRequest(
  130. anyAccount: map['AnyAccount'],
  131. );
  132. }
  133. Map<String, dynamic> toJson() {
  134. final map = Map<String, dynamic>();
  135. if(anyAccount != null)
  136. map['AnyAccount'] = anyAccount;
  137. return map;
  138. }
  139. }
  140. class CommonSignUpRequest {
  141. AccountString? anyAccount;
  142. VerificationCode? anyCode;
  143. PasswordString? password;
  144. Map<String,String>? headerMap;
  145. CommonSignUpRequest({
  146. this.anyAccount,
  147. this.anyCode,
  148. this.password,
  149. this.headerMap,
  150. });
  151. factory CommonSignUpRequest.fromJson(Map<String, dynamic> map) {
  152. return CommonSignUpRequest(
  153. anyAccount: map['AnyAccount'],
  154. anyCode: map['AnyCode'],
  155. password: map['Password'],
  156. headerMap: map['HeaderMap'] != null ? map['HeaderMap'].cast<String,String>() : null,
  157. );
  158. }
  159. Map<String, dynamic> toJson() {
  160. final map = Map<String, dynamic>();
  161. if(anyAccount != null)
  162. map['AnyAccount'] = anyAccount;
  163. if(anyCode != null)
  164. map['AnyCode'] = anyCode;
  165. if(password != null)
  166. map['Password'] = password;
  167. if(headerMap != null)
  168. map['HeaderMap'] = headerMap;
  169. return map;
  170. }
  171. }
  172. class PhoneString extends BaseParamsString{
  173. PhoneString({
  174. int length = 0,
  175. }) : super(
  176. length: length,
  177. );
  178. factory PhoneString.fromJson(Map<String, dynamic> map) {
  179. return PhoneString(
  180. length: map['Length'],
  181. );
  182. }
  183. Map<String, dynamic> toJson() {
  184. final map = super.toJson();
  185. return map;
  186. }
  187. }
  188. class CheckSMSVerificationCodeRequest {
  189. PhoneString? userPhone;
  190. VerificationCode? verifyCode;
  191. CheckSMSVerificationCodeRequest({
  192. this.userPhone,
  193. this.verifyCode,
  194. });
  195. factory CheckSMSVerificationCodeRequest.fromJson(Map<String, dynamic> map) {
  196. return CheckSMSVerificationCodeRequest(
  197. userPhone: map['UserPhone'],
  198. verifyCode: map['VerifyCode'],
  199. );
  200. }
  201. Map<String, dynamic> toJson() {
  202. final map = Map<String, dynamic>();
  203. if(userPhone != null)
  204. map['UserPhone'] = userPhone;
  205. if(verifyCode != null)
  206. map['VerifyCode'] = verifyCode;
  207. return map;
  208. }
  209. }
  210. class SendSMSVerificationCodeRequest {
  211. PhoneString? userPhone;
  212. SendSMSVerificationCodeRequest({
  213. this.userPhone,
  214. });
  215. factory SendSMSVerificationCodeRequest.fromJson(Map<String, dynamic> map) {
  216. return SendSMSVerificationCodeRequest(
  217. userPhone: map['UserPhone'],
  218. );
  219. }
  220. Map<String, dynamic> toJson() {
  221. final map = Map<String, dynamic>();
  222. if(userPhone != null)
  223. map['UserPhone'] = userPhone;
  224. return map;
  225. }
  226. }
  227. class EmailString extends BaseParamsString{
  228. EmailString({
  229. int length = 0,
  230. }) : super(
  231. length: length,
  232. );
  233. factory EmailString.fromJson(Map<String, dynamic> map) {
  234. return EmailString(
  235. length: map['Length'],
  236. );
  237. }
  238. Map<String, dynamic> toJson() {
  239. final map = super.toJson();
  240. return map;
  241. }
  242. }
  243. class SendEmailVerificationCodeRequest {
  244. EmailString? emailAddress;
  245. SendEmailVerificationCodeRequest({
  246. this.emailAddress,
  247. });
  248. factory SendEmailVerificationCodeRequest.fromJson(Map<String, dynamic> map) {
  249. return SendEmailVerificationCodeRequest(
  250. emailAddress: map['EmailAddress'],
  251. );
  252. }
  253. Map<String, dynamic> toJson() {
  254. final map = Map<String, dynamic>();
  255. if(emailAddress != null)
  256. map['EmailAddress'] = emailAddress;
  257. return map;
  258. }
  259. }
  260. class CheckEmailVerificationCodeRequest {
  261. EmailString? emailAddress;
  262. VerificationCode? verifyCode;
  263. CheckEmailVerificationCodeRequest({
  264. this.emailAddress,
  265. this.verifyCode,
  266. });
  267. factory CheckEmailVerificationCodeRequest.fromJson(Map<String, dynamic> map) {
  268. return CheckEmailVerificationCodeRequest(
  269. emailAddress: map['EmailAddress'],
  270. verifyCode: map['VerifyCode'],
  271. );
  272. }
  273. Map<String, dynamic> toJson() {
  274. final map = Map<String, dynamic>();
  275. if(emailAddress != null)
  276. map['EmailAddress'] = emailAddress;
  277. if(verifyCode != null)
  278. map['VerifyCode'] = verifyCode;
  279. return map;
  280. }
  281. }
  282. class RetrievePasswordByPhoneRequest {
  283. PhoneString? phone;
  284. VerificationCode? verifyCode;
  285. PasswordString? newPassword;
  286. RetrievePasswordByPhoneRequest({
  287. this.phone,
  288. this.verifyCode,
  289. this.newPassword,
  290. });
  291. factory RetrievePasswordByPhoneRequest.fromJson(Map<String, dynamic> map) {
  292. return RetrievePasswordByPhoneRequest(
  293. phone: map['Phone'],
  294. verifyCode: map['VerifyCode'],
  295. newPassword: map['NewPassword'],
  296. );
  297. }
  298. Map<String, dynamic> toJson() {
  299. final map = Map<String, dynamic>();
  300. if(phone != null)
  301. map['Phone'] = phone;
  302. if(verifyCode != null)
  303. map['VerifyCode'] = verifyCode;
  304. if(newPassword != null)
  305. map['NewPassword'] = newPassword;
  306. return map;
  307. }
  308. }
  309. class RetrievePasswordByEmailRequest {
  310. EmailString? mail;
  311. VerificationCode? verifyCode;
  312. PasswordString? newPassword;
  313. RetrievePasswordByEmailRequest({
  314. this.mail,
  315. this.verifyCode,
  316. this.newPassword,
  317. });
  318. factory RetrievePasswordByEmailRequest.fromJson(Map<String, dynamic> map) {
  319. return RetrievePasswordByEmailRequest(
  320. mail: map['Mail'],
  321. verifyCode: map['VerifyCode'],
  322. newPassword: map['NewPassword'],
  323. );
  324. }
  325. Map<String, dynamic> toJson() {
  326. final map = Map<String, dynamic>();
  327. if(mail != null)
  328. map['Mail'] = mail;
  329. if(verifyCode != null)
  330. map['VerifyCode'] = verifyCode;
  331. if(newPassword != null)
  332. map['NewPassword'] = newPassword;
  333. return map;
  334. }
  335. }
  336. class VerifyAccountRequest {
  337. AccountString? userName;
  338. VerifyAccountRequest({
  339. this.userName,
  340. });
  341. factory VerifyAccountRequest.fromJson(Map<String, dynamic> map) {
  342. return VerifyAccountRequest(
  343. userName: map['UserName'],
  344. );
  345. }
  346. Map<String, dynamic> toJson() {
  347. final map = Map<String, dynamic>();
  348. if(userName != null)
  349. map['UserName'] = userName;
  350. return map;
  351. }
  352. }