GET /api/private/v1/customers
分页查询当前项目中的客户列表。
查询参数
| 参数 | 类型 | 说明 |
|---|---|---|
page | number | 页码,默认 1 |
pageSize | number | 每页条数,默认 10,最大 100 |
search | string | 按用户名模糊搜索 |
成功响应
{
"ok": true,
"requestId": "req_123",
"data": {
"data": [
{
"id": 1,
"username": "customer_001",
"projectId": "clx_project",
"enabled": true,
"temporary": false,
"createdAt": "2026-03-01T00:00:00.000Z",
"updatedAt": "2026-03-01T00:00:00.000Z"
}
],
"total": 1,
"page": 1,
"pageSize": 10,
"totalPages": 1
}
}
POST /api/private/v1/customers
创建客户,并自动分配当前项目下所有免费套餐。
请求体
{
"username": "customer_001",
"enabled": true,
"password": "secret"
}
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
username | string | 是 | 8 到 16 位 |
enabled | boolean | 否 | 默认 true |
password | string | 否 | 创建密码凭证 |
成功响应
{
"ok": true,
"requestId": "req_124",
"data": {
"id": 2,
"username": "customer_002",
"projectId": "clx_project",
"enabled": true,
"temporary": false,
"createdAt": "2026-03-21T00:00:00.000Z",
"updatedAt": "2026-03-21T00:00:00.000Z"
}
}
HTTP 状态码为 201。创建成功后,系统会自动为该客户分配当前项目下所有免费套餐。