zhitong.yu
8 天以前 378d781e6f35f89652aa36e079a8b7fc44cea77e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// 请求响应参数(不包含data)
export interface Result {
  code: string;
  msg: string;
}
 
// 请求响应参数(包含data)
export interface ResultData<T = any> extends Result {
  mac: string;
  data: T;
}
 
// 分页响应参数
export interface ResPage<T> {
  list: T[];
  pageNum: number;
  pageSize: number;
  total: number;
}
 
// 分页请求参数
export interface ReqPage {
  pageNum: number;
  pageSize: number;
}
 
// 文件上传模块
export namespace Upload {
  export interface ResFileUrl {
    fileUrl: string;
  }
}
 
// 登录模块
export namespace Login {
  export interface ReqLoginForm {
    username: string;
    password: string;
    phone: string;
    smsCode: string;
  }
  export interface ResLogin {
    access_token: string;
  }
  export interface ResAuthButtons {
    [key: string]: string[];
  }
}
 
// 用户管理模块
export namespace User {
  export interface ReqUserParams extends ReqPage {
    username: string;
    gender: number;
    idCard: string;
    email: string;
    address: string;
    createTime: string[];
    status: number;
  }
  export interface ResUserList {
    id: string;
    username: string;
    gender: number;
    user: { detail: { age: number } };
    idCard: string;
    email: string;
    address: string;
    createTime: string;
    status: number;
    avatar: string;
    photo: any[];
    children?: ResUserList[];
  }
  export interface ResStatus {
    userLabel: string;
    userValue: number;
  }
  export interface ResGender {
    genderLabel: string;
    genderValue: number;
  }
  export interface ResDepartment {
    id: string;
    name: string;
    children?: ResDepartment[];
  }
  export interface ResRole {
    id: string;
    name: string;
    children?: ResDepartment[];
  }
}
 
// AI智能助手模块
export namespace aiChat {
  export interface ReqAIChat {
    message: string;
    history?: Array<{
      type: 'user' | 'ai';
      content: string;
      time: string;
    }>;
  }
  export interface ResAIChat {
    reply: string;
    timestamp: string;
    model: string;
  }
  export interface ResAIStatus {
    status: 'online' | 'offline' | 'error';
    model: string;
    version: string;
    lastUpdate: string;
  }
}