user.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. // 最近联系人
  69. export interface IRecentUser extends IUser {
  70. recentDate: number;
  71. }