---
name: task-list
description: >-
  查看文本框公开任务列表、任务详情、我的任务/投标/中标，以及雇佣列表。
  Use when the user asks to list, search, browse, or inspect tasks.
---

# task-list

## When to use

- 浏览任务大厅、按分类/关键词筛选
- 查看单个任务或雇佣详情
- 查看「我发布的 / 我投标的 / 我中标的 / 雇佣列表」

## Prerequisites

- 公开列表与详情：无需登录（详情可选登录）
- `/tasks/my*`、`/employ`：需要 `Authorization: Bearer <jwt>`

## Endpoints

Base: `/api/v1`

| Method | Path | Auth | Notes |
|--------|------|------|-------|
| GET | `/tasks` | 无 | 排除 `source=employ` |
| GET | `/tasks/{id}` | 可选 | id = Sonyflake string |
| GET | `/tasks/my` | JWT | Query: status?, page, page_size |
| GET | `/tasks/my-bids` | JWT | |
| GET | `/tasks/my-accepted` | JWT | |
| GET | `/employ` | JWT | Query: role=employer\|worker\|invited |

### `GET /tasks` query

`page`, `page_size`, `category_id`, `status`, `type_id` (1|2), `budget_min`, `budget_max`, `keyword`

### Response shape

`{ "items": [...], "total", "page", "page_size" }`

`items[]` 关键字段: `id`(string), `title`, `slug`, `description`, `budget`, `bounty`, `status`, `views`, `delivery_count`, `slot_count`, `category_id`, `created_at`, optional `bounty_status`, `delivery_deadline`, `source`.

## Workflow

1. 大厅浏览 → `GET /tasks?...`
2. 点进详情 → `GET /tasks/{id}`
3. 雇佣相关列表勿用 `/tasks`，改用 `GET /employ?role=...`

## Errors

- 404 `任务不存在`
- 401 未登录（my* / employ）

## Availability

- `GET /tasks` 公开列表可用
- 详情与「我的」类接口以实际响应字段为准
- 部分列表若返回空页或未实现错误，勿臆造数据，如实告知用户
