5a18dbb8a2
- feedback:contact 由必填改可选(客户端原型改版已不再采集,保留字段兼容旧端); 上传图片上限 4→6;admin 反馈列表新增 内容/创建时间 筛选 + id/created_at 排序 - admin:admins/users/withdraw/price_report/ad_audit 路由及 schemas 配套调整 - wallet 仓储调整;docs(api/database)同步 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2.4 KiB
2.4 KiB
GET /admin/api/feedbacks — 反馈工单列表(offset 分页 + 筛选/排序)
所属:Admin·反馈 组(前缀
/admin/api/feedbacks) | 鉴权:Bearer admin_token(角色:任意已登录管理员,无require_role,仅get_current_admin) | ← 返回 API 索引
入参(query)
| 字段 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
status |
string | ❌ | null | 反馈状态,精确匹配:new(待处理) / handled(已处理);传空/不传则不筛 |
user_id |
int | ❌ | null | 按提交用户 id 精确筛 |
content |
string | ❌ | null | 反馈内容模糊匹配(ilike,≤100 字) |
created_from |
datetime | ❌ | null | 提交时间 ≥(ISO,统一按 UTC 比较) |
created_to |
datetime | ❌ | null | 提交时间 ≤(ISO,统一按 UTC 比较) |
sort_by |
string | ❌ | id |
排序列:id / created_at |
sort_order |
string | ❌ | desc |
asc / desc |
limit |
int | ❌ | 20 | 1–100 |
cursor |
int | ❌ | null | 上一页 next_cursor(offset 分页,cursor=offset) |
出参
响应 200:{ items: FeedbackOut[], next_cursor: int|null }(next_cursor=null 表示末页)
FeedbackOut
| 字段 | 类型 | 说明 |
|---|---|---|
id |
int | 反馈 id |
user_id |
int | 提交用户 id |
content |
string | 反馈内容 |
contact |
string | 联系方式(微信/QQ/手机,便于回访) |
images |
string[] | null | 截图相对路径列表(如 ["/media/feedback/u1_ab12.jpg"]),无图为 null |
status |
string | 反馈状态:new(待处理) / handled(已处理) |
created_at |
datetime | 提交时间(UTC) |
错误码
401未带/无效/过期 admin token、管理员被禁用(头带WWW-Authenticate: Bearer)422limit超出 1–100 范围 /sort_by·sort_order不在允许集 / 字段类型不合法
说明
- offset 分页(同 admin-users-list):
cursor即 offset,传上一页返回的next_cursor;next_cursor=null即末页。改用 offset 是为了在任意列排序下游标语义统一,代价是翻页期间数据变动可能错位一条(admin 低频可接受)。 - 排序:
sort_by(id/created_at)×sort_order(asc/desc),恒以id同向兜底次序。 status/user_id精确匹配、content模糊、created_from/created_to时间范围,均可叠加。- 关联表 feedback;截图为相对路径,经
GET /media/feedback/<file>静态读。