主题
模型数据 API
查询记录列表
GET /api/v1/models/{modelName}/records查询参数:
| 参数 | 类型 | 说明 |
|---|---|---|
page | number | 页码,默认 1 |
pageSize | number | 每页条数,默认 20,最大 100 |
filter | JSON | 筛选条件,见下方说明 |
sort | string | 排序字段,如 -createdAt(负号表示降序) |
筛选条件示例:
json
{ "status": "active", "amount": { "$gte": 1000 } }示例请求:
bash
curl -H "Authorization: Bearer your-token" \
"https://your-domain/api/v1/models/customers/records?pageSize=10"创建记录
POST /api/v1/models/{modelName}/records
Content-Type: application/json
{
"name": "新客户",
"status": "active",
"amount": 5000
}更新记录
PATCH /api/v1/models/{modelName}/records/{id}
Content-Type: application/json
{
"status": "closed"
}删除记录
DELETE /api/v1/models/{modelName}/records/{id}