user.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. import { ICompilation, ICptItem } from './compilation';
  2. /* eslint-disable camelcase */
  3. export enum ELockInfo {
  4. BORROW = 1, // 借用
  5. BUY = 2, // 销售
  6. }
  7. export interface IUpgradeInfo {
  8. compilationID: string;
  9. isUpgrade: boolean;
  10. lock?: ELockInfo;
  11. [key: string]: any;
  12. }
  13. // 实体类型
  14. export enum EntityType {
  15. // 个人
  16. PERSON = 1,
  17. // 企业
  18. ENTERPRISE,
  19. }
  20. export enum UserType {
  21. NORMAL = 'normal',
  22. PROFESSIONAL = 'professional',
  23. }
  24. export interface IContact {
  25. userID: string;
  26. }
  27. export interface IUsed {
  28. compilationId: string;
  29. }
  30. // user 表原始字段
  31. export interface IRawUser {
  32. _id?: string;
  33. qq?: string;
  34. real_name?: string;
  35. avatar?: string;
  36. position?: string;
  37. company?: string;
  38. province?: number;
  39. company_type?: number;
  40. company_scale?: number;
  41. latest_login?: number;
  42. user_type?: string;
  43. contacts?: IContact[];
  44. isSmsLogin?: number;
  45. isLoginValid?: number;
  46. ssoId?: string;
  47. email?: string;
  48. mobile?: string;
  49. create_time?: string;
  50. isUserActive?: number;
  51. upgrade_list?: IUpgradeInfo[];
  52. used_list?: IUsed[];
  53. latest_used?: string;
  54. [key: string]: any;
  55. }
  56. // 返回给前端的字段
  57. export interface IUser {
  58. ID?: string;
  59. qq?: string;
  60. realName?: string;
  61. avatar?: string;
  62. position?: string;
  63. company?: string;
  64. province?: number;
  65. companyType?: number;
  66. companyScale?: number;
  67. latestLogin?: number;
  68. userType?: string;
  69. contacts?: IContact[];
  70. isSmsLogin?: number;
  71. isLoginValid?: number;
  72. ssoID?: string;
  73. email?: string;
  74. mobile?: string;
  75. createTime?: string;
  76. isUserActive?: number;
  77. upgradeList?: IUpgradeInfo[];
  78. usedList?: IUsed[];
  79. latestUsed?: string;
  80. [key: string]: any;
  81. }
  82. export interface IUserSession extends IUser {
  83. enterpriseID: string; // 企业ID
  84. }
  85. // 最近联系人
  86. export interface IRecentUser extends IUser {
  87. recentDate: number;
  88. }
  89. export interface IBootResult {
  90. compilation: ICompilation;
  91. complete: boolean;
  92. }
  93. export interface ILoginResult {
  94. userInfo: IUser;
  95. cptList: ICptItem;
  96. }