跳到主要内容

GET /api/private/v1/customers

分页查询当前项目中的客户列表。

查询参数

参数类型说明
pagenumber页码,默认 1
pageSizenumber每页条数,默认 10,最大 100
searchstring按用户名模糊搜索

成功响应

{
"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"
}
字段类型必填说明
usernamestring8 到 16 位
enabledboolean默认 true
passwordstring创建密码凭证

成功响应

{
"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。创建成功后,系统会自动为该客户分配当前项目下所有免费套餐。