user.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. import { IProCptItem } from './compilation';
  2. // 实体类型
  3. export enum EntityType {
  4. // 个人
  5. PERSON = 1,
  6. // 企业
  7. ENTERPRISE = 2,
  8. }
  9. // 登录类型(与实体类型有语义上的区别)
  10. export enum LoginType {
  11. PERSON = 'person',
  12. ENTERPRISE = 'enterprise',
  13. }
  14. // 登录方式(使用密码还是短信进行登录,与登录类型是不同概念)
  15. export enum LoginMode {
  16. PASSWORD = 'password',
  17. SMS = 'sms',
  18. }
  19. export enum UserType {
  20. NORMAL = 'normal',
  21. PROFESSIONAL = 'professional',
  22. }
  23. export interface IUsedCptItem {
  24. // 编办 ID
  25. compilationID: string;
  26. // 第一次使用的时间
  27. firstUseTime: number;
  28. }
  29. export interface IContactItem {
  30. // 用户 ID
  31. userID: string;
  32. // 第一成为联系人的时间
  33. firstContactTime: number;
  34. }
  35. export interface IEverydayOnlineTimeItem {
  36. // 日期
  37. date: number;
  38. // 在线时长
  39. onlineTime: number;
  40. }
  41. export interface ISummary {
  42. // 最后登录时间
  43. lastLoginTime: number;
  44. // 上次使用的编办
  45. lastUsedCpt: string;
  46. // 总共在线时长
  47. totalOnlineTime: number;
  48. // 今天目前的在线时长
  49. todayOnlineTime: number;
  50. // 每天的在线时长
  51. everydayOnlineTime: IEverydayOnlineTimeItem[];
  52. }
  53. export interface IUser {
  54. ID: string;
  55. ssoID: string;
  56. mobile: string;
  57. realName: string;
  58. createTime: number;
  59. proCptList: IProCptItem[];
  60. usedCptList: IUsedCptItem[];
  61. specifyCpt: string;
  62. contacts: IContactItem[];
  63. onlySMSLogin: boolean;
  64. abnormalLoginAlert: boolean;
  65. defaultEnterprise: string;
  66. summaryInfo: ISummary;
  67. }
  68. export interface IAPInstitution {
  69. ID: string;
  70. name: string;
  71. }
  72. export interface IAPOrganizationalStructure {
  73. ID: string;
  74. name: string;
  75. }
  76. export interface IAPUser {
  77. ID: string;
  78. createdTime: number;
  79. gender: string;
  80. accountType: number;
  81. account: string;
  82. name: string;
  83. phone: string;
  84. institution: IAPInstitution;
  85. organizationalStructure: IAPOrganizationalStructure;
  86. dataID: string;
  87. created: string;
  88. createdID: string; // 创建人ID
  89. isCreated?: boolean; // 是否可创建,字段由后台定义
  90. }
  91. // 最近联系人
  92. export interface IRecentUser extends IUser {
  93. recentDate: number;
  94. }
  95. // 正在查看项目的用户
  96. export interface IViewingProjectUser {
  97. projectID: string;
  98. userID: string;
  99. userName: string;
  100. mobile: string;
  101. enterpriseID: string;
  102. enterpriseName: string;
  103. }