Accounts.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. import format from 'date-fns/format';
  17. import { BaseEntity } from './BaseEntity';
  18. export class Accounts extends BaseEntity {
  19. strategyId!: String;
  20. strategyName!: String;
  21. appId!: String;
  22. appName!: String;
  23. userId!: String;
  24. username!: String;
  25. displayName!: String;
  26. relatedUsername!: String;
  27. relatedPassword!: String;
  28. createType!: String;
  29. confirmPassword!: String;
  30. constructor() {
  31. super();
  32. this.createType = 'manual';
  33. }
  34. override init(data: any): void {
  35. Object.assign(this, data);
  36. if (this.status == 1) {
  37. this.switch_status = true;
  38. }
  39. }
  40. override trans(): void {
  41. if (this.switch_status) {
  42. this.status = 1;
  43. } else {
  44. this.status = 0;
  45. }
  46. }
  47. }