extractTaskIDFromPath 从路径中提取任务 ID 路径格式: /api/v1/tasks/:id
(path string)
| 178 | // extractTaskIDFromPath 从路径中提取任务 ID |
| 179 | // 路径格式: /api/v1/tasks/:id |
| 180 | func extractTaskIDFromPath(path string) string { |
| 181 | parts := strings.Split(strings.Trim(path, "/"), "/") |
| 182 | if len(parts) < 4 { |
| 183 | return "" |
| 184 | } |
| 185 | return parts[3] |
| 186 | } |
| 187 | |
| 188 | // convertTaskProgressToResponse renders a task's current state, computing |
| 189 | // percent and speed from the snapshot taken under the task's mutex. |
no outgoing calls