|
1 | 1 | import { client } from "./client" |
2 | | -import type { AxiosResponse } from "axios" |
3 | 2 |
|
4 | 3 | class Request { |
5 | 4 | /** |
6 | 5 | * get_bili_config. |
7 | 6 | * @param {Object} params 传递给服务器的参数对象。 |
8 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 7 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
9 | 8 | */ |
10 | | - async getBiliConfig(params: {}): Promise<AxiosResponse<any>> { |
| 9 | + async getBiliConfig(params: {}): Promise<ResponseModel> { |
11 | 10 | return await client.get("/api/get_bili_config", params) |
12 | 11 | } |
13 | 12 |
|
14 | 13 | /** |
15 | 14 | * add_or_update_bili_config. |
16 | 15 | * @param {Object} params 传递给服务器的参数对象。 |
17 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 16 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
18 | 17 | */ |
19 | | - async addOrUpdateBiliConfig(params: {}): Promise<AxiosResponse<any>> { |
| 18 | + async addOrUpdateBiliConfig(params: {}): Promise<ResponseModel> { |
20 | 19 | return await client.post("/api/add_or_update_bili_config", params) |
21 | 20 | } |
22 | 21 |
|
23 | 22 | /** |
24 | 23 | * get_bili_credential_list. |
25 | 24 | * @param {Object} params 传递给服务器的参数对象。 |
26 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 25 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
27 | 26 | */ |
28 | | - async getBiliCredentialList(params: {}): Promise<AxiosResponse<any>> { |
| 27 | + async getBiliCredentialList(params: {}): Promise<ResponseModel> { |
29 | 28 | return await client.get("/api/get_bili_credential_list", params) |
30 | 29 | } |
31 | 30 |
|
32 | 31 | /** |
33 | 32 | * refresh_bili_credential. |
34 | 33 | * @param {Object} params 传递给服务器的参数对象。 |
35 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 34 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
36 | 35 | */ |
37 | | - async refreshBiliCredential(params: {}): Promise<AxiosResponse<any>> { |
| 36 | + async refreshBiliCredential(params: {}): Promise<ResponseModel> { |
38 | 37 | return await client.get("/api/refresh_bili_credential", params) |
39 | 38 | } |
40 | 39 |
|
41 | 40 | /** |
42 | 41 | * delete_bili_credential. |
43 | 42 | * @param {Object} params 传递给服务器的参数对象。 |
44 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 43 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
45 | 44 | */ |
46 | | - async deleteBiliCredential(params: {}): Promise<AxiosResponse<any>> { |
| 45 | + async deleteBiliCredential(params: {}): Promise<ResponseModel> { |
47 | 46 | return await client.post("/api/delete_bili_credential", params) |
48 | 47 | } |
49 | 48 |
|
50 | 49 | /** |
51 | 50 | * update_bili_credential. |
52 | 51 | * @param {Object} params 传递给服务器的参数对象。 |
53 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 52 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
54 | 53 | */ |
55 | | - async updateBiliCredential(params: {}): Promise<AxiosResponse<any>> { |
| 54 | + async updateBiliCredential(params: {}): Promise<ResponseModel> { |
56 | 55 | return await client.post("/api/update_bili_credential", params) |
57 | 56 | } |
58 | 57 |
|
59 | 58 | /** |
60 | 59 | * get_bili_credential_code. |
61 | 60 | * @param {Object} params 传递给服务器的参数对象。 |
62 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 61 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
63 | 62 | */ |
64 | | - async getBiliCredentialCode(params: {}): Promise<AxiosResponse<any>> { |
| 63 | + async getBiliCredentialCode(params: {}): Promise<ResponseModel> { |
65 | 64 | return await client.get("/api/get_bili_credential_code", params) |
66 | 65 | } |
67 | 66 |
|
68 | 67 | /** |
69 | 68 | * check_qr_code. |
70 | 69 | * @param {Object} params 传递给服务器的参数对象。 |
71 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 70 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
72 | 71 | */ |
73 | | - async checkQrCode(params: {}): Promise<AxiosResponse<any>> { |
| 72 | + async checkQrCode(params: {}): Promise<ResponseModel> { |
74 | 73 | return await client.get("/api/check_qr_code", params) |
75 | 74 | } |
76 | 75 |
|
77 | 76 | /** |
78 | 77 | * get_dy_config. |
79 | 78 | * @param {Object} params 传递给服务器的参数对象。 |
80 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 79 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
81 | 80 | */ |
82 | | - async getDyConfig(params: {}): Promise<AxiosResponse<any>> { |
| 81 | + async getDyConfig(params: {}): Promise<ResponseModel> { |
83 | 82 | return await client.get("/api/get_dy_config", params) |
84 | 83 | } |
85 | 84 |
|
86 | 85 | /** |
87 | 86 | * add_or_update_dy_config. |
88 | 87 | * @param {Object} params 传递给服务器的参数对象。 |
89 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 88 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
90 | 89 | */ |
91 | | - async addOrUpdateDyConfig(params: {}): Promise<AxiosResponse<any>> { |
| 90 | + async addOrUpdateDyConfig(params: {}): Promise<ResponseModel> { |
92 | 91 | return await client.post("/api/add_or_update_dy_config", params) |
93 | 92 | } |
94 | 93 |
|
95 | 94 | /** |
96 | 95 | * get_global_config. |
97 | 96 | * @param {Object} params 传递给服务器的参数对象。 |
98 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 97 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
99 | 98 | */ |
100 | | - async getGlobalConfig(params: {}): Promise<AxiosResponse<any>> { |
| 99 | + async getGlobalConfig(params: {}): Promise<ResponseModel> { |
101 | 100 | return await client.get("/api/get_global_config", params) |
102 | 101 | } |
103 | 102 |
|
104 | 103 | /** |
105 | 104 | * add_or_update_global_config. |
106 | 105 | * @param {Object} params 传递给服务器的参数对象。 |
107 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 106 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
108 | 107 | */ |
109 | | - async addOrUpdateGlobalConfig(params: {}): Promise<AxiosResponse<any>> { |
| 108 | + async addOrUpdateGlobalConfig(params: {}): Promise<ResponseModel> { |
110 | 109 | return await client.post("/api/add_or_update_global_config", params) |
111 | 110 | } |
112 | 111 |
|
113 | 112 | /** |
114 | 113 | * get_history_list. |
115 | 114 | * @param {Object} params 传递给服务器的参数对象。 |
116 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 115 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
117 | 116 | */ |
118 | | - async getHistoryList(params: {}): Promise<AxiosResponse<any>> { |
| 117 | + async getHistoryList(params: {}): Promise<ResponseModel> { |
119 | 118 | return await client.get("/api/get_history_list", params) |
120 | 119 | } |
121 | 120 |
|
122 | 121 | /** |
123 | 122 | * check_update. |
124 | 123 | * @param {Object} params 传递给服务器的参数对象。 |
125 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 124 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
126 | 125 | */ |
127 | | - async checkUpdate(params: {}): Promise<AxiosResponse<any>> { |
| 126 | + async checkUpdate(params: {}): Promise<ResponseModel> { |
128 | 127 | return await client.get("/api/check_updates", params) |
129 | 128 | } |
130 | 129 |
|
131 | 130 | /** |
132 | 131 | * get_playlist_list. |
133 | 132 | * @param {Object} params 传递给服务器的参数对象。 |
134 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 133 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
135 | 134 | */ |
136 | | - async getPlaylistList(params: {}): Promise<AxiosResponse<any>> { |
| 135 | + async getPlaylistList(params: {}): Promise<ResponseModel> { |
137 | 136 | return await client.get("/api/get_playlist_list", params) |
138 | 137 | } |
139 | 138 |
|
140 | 139 | /** |
141 | 140 | * get_playlist. |
142 | 141 | * @param {Object} params 传递给服务器的参数对象。 |
143 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 142 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
144 | 143 | */ |
145 | | - async getPlaylist(params: {}): Promise<AxiosResponse<any>> { |
| 144 | + async getPlaylist(params: {}): Promise<ResponseModel> { |
146 | 145 | return await client.get("/api/get_playlist", params) |
147 | 146 | } |
148 | 147 |
|
149 | 148 | /** |
150 | 149 | * add_or_update_playlist. |
151 | 150 | * @param {Object} params 传递给服务器的参数对象。 |
152 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 151 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
153 | 152 | */ |
154 | | - async addOrUpdatePlaylist(params: {}): Promise<AxiosResponse<any>> { |
| 153 | + async addOrUpdatePlaylist(params: {}): Promise<ResponseModel> { |
155 | 154 | return await client.post("/api/add_or_update_playlist", params) |
156 | 155 | } |
157 | 156 |
|
158 | 157 | /** |
159 | 158 | * delete_playlist. |
160 | 159 | * @param {Object} params 传递给服务器的参数对象。 |
161 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 160 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
162 | 161 | */ |
163 | | - async deletePlaylist(params: {}): Promise<AxiosResponse<any>> { |
| 162 | + async deletePlaylist(params: {}): Promise<ResponseModel> { |
164 | 163 | return await client.post("/api/delete_playlist", params) |
165 | 164 | } |
166 | 165 |
|
167 | 166 | /** |
168 | 167 | * import_playlist. |
169 | 168 | * @param {Object} params 传递给服务器的参数对象。 |
170 | | - * @returns {Promise<AxiosResponse<any>>} 操作的响应。 |
| 169 | + * @returns {Promise<ResponseModel>} 操作的响应。 |
171 | 170 | */ |
172 | | - async importPlaylist(params: {}): Promise<AxiosResponse<any>> { |
| 171 | + async importPlaylist(params: {}): Promise<ResponseModel> { |
173 | 172 | return await client.post("/api/import_playlist", params) |
174 | 173 | } |
175 | 174 |
|
|
0 commit comments