login.m.dart 7.4 KB

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