API 调用地址
{域名地址}/api/tag/data/list
说明:{域名地址}
需要替换成你的域名地址,如 /api/tag/data/list
调用方法
GET
请求参数
字段名 | 类型 | 必填 | 说明 |
---|---|---|---|
id | int | 是 | 标签ID,如果传了filename,可以不用传ID |
filename | string | 否 | 标签URL别名,标签ID、filename 二选一 |
order | string | 否 | 排序方式,如:id desc ,支持的字段有:id 、views 、category_id 、created_time 、updated_time 等 |
type | int | 否 | 支持按 page 、list 、related 方式列出。默认值为list ,type="list" 时,只会显示 指定的 limit 指定的数量,如果type="page" 则可获取文档数量 total |
page | int | 否 | 指定获取第几页内容,仅当type="page"时候生效 |
limit | int | 否 | 显示数量,limit 可以指定显示数量,按多少数量来分页,比如limit="10"则只会显示10条,limit 在不是分页列表的时候,支持offset模式,也就是 ,分隔模式,如想从第2条开始,获取10条数据,可以设置成 limit="2,10"。 |
返回参数
字段名 | 类型 | 说明 |
---|---|---|
code | int | 错误码 |
msg | string | 错误原因说明 |
data | object[] | 结果内容 |
total | int | 文档数量,仅当type=page的时候会返回 |
data结果item参数
字段名 | 类型 | 说明 |
---|---|---|
id | int | 文档ID |
title | string | 文档标题 |
seo_title | string | 文档SEO标题 |
url_token | string | 文档URL别名 |
keywords | string | 文档关键词 |
description | string | 文档简介 |
module_id | int | 文档模型ID |
category_id | int | 文档分类ID |
views | int | 文档浏览量 |
comment_count | int | 文档评论量 |
images | string[] | 文档组图 |
logo | string | 文档Logo |
thumb | string | 文档缩略图 |
flag | string | 文档推荐属性,头条[h]推荐[c]幻灯[f]特荐[a]滚动[s]加粗[h]图片[p]跳转[j] |
canonical_url | string | canonical url |
fixed_link | string | 文档固定链接 |
created_time | int | 文档发布时间戳 |
updated_time | int | 文档更新时间戳 |
status | int | 文档显示状态 |
user_id | int | 用户ID |
price | int | 价格,单位分 |
stock | int | 库存量 |
user_id | int | 用户ID |
请求数据示例
参数 | 值 |
---|---|
id | 1 |
type | page |
返回数据示例
{
"code": 0,
"data": [
{
"id": 1,
"created_time": 1607308159,
"updated_time": 1662717106,
"title": "关于AnqiCMS",
"seo_title": "",
"url_token": "design",
"keywords": "",
"description": "安企内容管理系统(AnqiCMS),是一款使用 GoLang 开发的企业站内容管理系统,它部署简单,软件安全,界面优雅,小巧,执行速度飞快,使用 AnqiCMS 搭建的网站可以防止众多安全问题发生。",
"module_id": 1,
"category_id": 1,
"views": 1338,
"comment_count": 0,
"images": null,
"template": "",
"status": 1,
"canonical_url": "",
"fixed_link": "",
"flag": "",
"user_id": 0,
"price": 0,
"stock": 9999999,
"has_pseudo": 0,
"keyword_id": 0,
"origin_url": "",
"origin_title": "",
"category": null,
"module_name": "",
"data": null,
"logo": "/uploads/202012/7/bd36c37ef742c7be.webp",
"thumb": "/uploads/202012/7/thumb_bd36c37ef742c7be.webp",
"extra": {
"author": {
"name": "作者",
"value": "AnqiCMS",
"default": null
},
"certificate": {
"name": "学历",
"value": null,
"default": null
},
"city": {
"name": "城市",
"value": null,
"default": null
}
},
"link": "/design"
},
{
"id": 2,
"created_time": 1607308247,
"updated_time": 1611373941,
"title": "AnqiCMS使用帮助",
"seo_title": "",
"url_token": "help",
"keywords": "",
"description": "anqicms常见问题汇总",
"module_id": 1,
"category_id": 1,
"views": 1655,
"comment_count": 0,
"images": null,
"template": "",
"status": 1,
"canonical_url": "",
"fixed_link": "",
"flag": "",
"user_id": 0,
"price": 0,
"stock": 9999999,
"has_pseudo": 0,
"keyword_id": 0,
"origin_url": "",
"origin_title": "",
"category": null,
"module_name": "",
"data": null,
"logo": "/uploads/202012/7/bd36c37ef742c7be.webp",
"thumb": "/uploads/202012/7/thumb_bd36c37ef742c7be.webp",
"extra": null,
"link": "/help"
},
],
"msg": "",
"total": 2
}
错误代码
错误码 | 说明 |
---|---|
0 | OK |
-1 | 错误,错误原因在msg中指出 |
1001 | 未登录 |
1002 | 未授权 |
200 | API请求OK |