user.ts 2.2 KB

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