获取模型列表接口

API 调用地址

{域名地址}/api/module/list

说明:{域名地址} 需要替换成你的域名地址,如 https://www.anqicms.com/api/module/list

调用方法

GET

请求参数

返回参数

字段名 类型 说明
code int 错误码
msg string 错误原因说明
data object[] 结果内容

data 结果 item 参数

字段名 类型 说明
id int 模型 ID
title string 模型名称
table_name string 附加表名
url_token string 模型 URL 别名
is_system int 是否系统内置模型
title_name string 标题名称
fields object[] 模型自定义字段列表
created_time int 模型发布时间戳
updated_time int 模型更新时间戳
status int 模型显示状态

模型自定义字段 field

字段名 类型 说明
name string 字段中文名称
field_name string 字段名称
type string 字段类型
required boolean 是否必填
is_system boolean 是否系统内置字段
is_filter boolean 是否筛选参数
follow_level boolean 是否跟随文档阅读等级
content string 默认值

请求数据示例

返回数据示例

{
  "code": 0,
  "data": [
    {
      "id": 1,
      "created_time": 1689603570,
      "updated_time": 1689924577,
      "table_name": "article",
      "url_token": "news",
      "title": "文章中心",
      "fields": null,
      "is_system": 1,
      "title_name": "标题",
      "status": 1,
      "link": ""
    },
    {
      "id": 2,
      "created_time": 1689603570,
      "updated_time": 1702908648,
      "table_name": "product",
      "url_token": "product",
      "title": "产品中心",
      "fields": [
        {
          "name": "产品参数",
          "field_name": "canshu",
          "type": "text",
          "required": false,
          "is_system": false,
          "is_filter": false,
          "follow_level": false,
          "content": ""
        },
        {
          "name": "批号",
          "field_name": "pihao",
          "type": "text",
          "required": false,
          "is_system": false,
          "is_filter": false,
          "follow_level": false,
          "content": ""
        }
      ],
      "is_system": 1,
      "title_name": "产品名称",
      "status": 1,
      "link": ""
    }
  ],
  "msg": ""
}

错误代码

错误码 说明
0 OK
-1 错误,错误原因在 msg 中指出
1001 未登录
1002 未授权
200 API 请求 OK