企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## 评论接口(Comment) ## 文档评论列表接口\[index\]【免登录】 文档评论列表接口 ### 请求URL http://www.yoursite.com/addons/cms/api.comment/index ### 请求方法 GET ### 请求参数 | Body参数名 | 类型 | 必需 | 描述 | 示例 e.g. | | --- | --- | --- | --- | --- | | aid | number | 否 | 文档id | 1 | | page | number | 否 | 分页页码 | 1 | ### 返回值 ~~~css { "code": 1, "msg": "", "time": "1616740235", "data": { "commentList": [ { "id": 22, "user_id": 1, "pid": 0, "content": "评论1", "comments": 0, "createtime": 1597980067, "user": { "id": 1, "nickname": "admin", "avatar": "", "url": "/u/1" }, "create_date": "7月前" }, { "id": 21, "user_id": 2, "pid": 0, "content": "评论2", "comments": 0, "createtime": 1597717125, "user": { "id": 2, "nickname": "test", "avatar": "", "url": "/u/2" }, "create_date": "7月前" } ] } } ~~~ ## 发表评论接口\[post\]【需登录】 发表评论 ### 请求URL http://www.yoursite.com/addons/cms/api.comment/post ### 请求方法 POST ### 请求参数 | Body参数名 | 类型 | 必需 | 描述 | 示例 e.g. | | --- | --- | --- | --- | --- | | aid | number | 是 | 文档id | 1 | | content | string | 是 | 评论内容 | 评论1 | | pid | number | 是 | 评论id (用于回复) | 1 | ### 返回值 ~~~json { "code": 1, "msg": "评论成功", "time": "1616740507", "data": { "comment": { "id": 101, "user_id": 2, "type": "archives", "aid": 109, "pid": 0, "content": "我是一个评论", "comments": 0, "ip": "127.0.0.1", "useragent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1", "subscribe": 0, "createtime": 1616740507, "updatetime": 1616740507, "deletetime": null, "status": "normal", "user": { "id": 2, "nickname": "test", "avatar": "", "url": "/u/2" }, "create_date": "0秒前" }, "__token__": "29d1c782a0cf7b7830a3208c614b627f" } } ~~~