内容接口
模板接口
读取建站模板列表与详情,支持按行业、色系筛选,用于模板库展示。
获取模板列表
GET
/_api/templates公开接口分页获取已上架模板,可按行业与色系筛选。
Query 参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| page | integer | 否 | 页码。 |
| pageSize | integer | 否 | 每页条数。 |
| q | string | 否 | 关键字,命中模板名称或编码。 |
| firstIndustry | integer | 否 | 一级行业 Id;0 视为全部。 |
| secondIndustry | integer | 否 | 二级行业 Id。 |
| colorType | string | 否 | 色系编码,如 LanSe。 |
| sortBy | string | 否 | createdAt(最新)或 useCount(最热)。 |
响应示例
{
"items": [
{
"id": "6f708192-a3b4-c5d6-e7f8-091a2b3c4d5e",
"templateCode": "TPL-10023",
"name": "科技蓝色企业官网",
"thumbnailUrl": "/AppUpload/Image/template-10023.webp",
"demoUrl": "https://demo.example.com/10023",
"colorType": "LanSe",
"firstIndustry": 1,
"secondIndustry": 11,
"useCount": 2100,
"sortOrder": 0,
"isPublished": true,
"isRecommended": true,
"createdAt": "2025-09-01T00:00:00Z",
"updatedAt": "2025-09-01T00:00:00Z"
}
],
"page": 1,
"pageSize": 20,
"total": 1168,
"totalPages": 59
}获取模板详情
GET
/_api/templates/{id}公开接口获取已上架模板详情。
路径参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| id | uuid | 是 | 模板 Id。 |
响应示例
{
"id": "6f708192-a3b4-c5d6-e7f8-091a2b3c4d5e",
"templateCode": "TPL-10023",
"name": "科技蓝色企业官网",
"thumbnailUrl": "/AppUpload/Image/template-10023.webp",
"demoUrl": "https://demo.example.com/10023",
"colorType": "LanSe",
"firstIndustry": 1,
"secondIndustry": 11,
"useCount": 2100,
"isPublished": true,
"isRecommended": true
}