(url: string, body: Record<string, unknown>)
| 200 | } |
| 201 | |
| 202 | private async routeRequest(url: string, body: Record<string, unknown>): Promise<ApiResponse> { |
| 203 | switch (url) { |
| 204 | case '/api/window/show': |
| 205 | return this.handleShowWindow(body) |
| 206 | case '/api/window/hide': |
| 207 | return this.handleHideWindow() |
| 208 | case '/api/window/toggle': |
| 209 | return this.handleToggleWindow() |
| 210 | default: |
| 211 | return { code: 404, message: `未知接口: ${url}` } |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | private handleShowWindow(body: Record<string, unknown>): ApiResponse { |
| 216 | try { |
no test coverage detected