itecdn 5.x用户文档
itecdn 5.x / 用户 API

查询套餐组列表

GET/v1/package-groups

分页查询套餐组,并按排序值升序返回。普通登录用户仅能看到 enable 为 1 的套餐组;管理员可查看全部套餐组。

身份认证

access-token

api-key + api-secret

认证定义
{
  "AccessToken": {
    "type": "apiKey",
    "in": "header",
    "name": "access-token",
    "description": "通过登录接口获得的短期访问令牌。"
  },
  "ApiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "api-key",
    "description": "API Key;必须和 api-secret 同时发送。"
  },
  "ApiSecret": {
    "type": "apiKey",
    "in": "header",
    "name": "api-secret",
    "description": "API Secret;必须和 api-key 同时发送。"
  }
}

请求参数

参数位置类型必填说明与约束
pagequeryinteger可选

页码,必须为非负数字字符串或数字;默认 1。

完整参数定义
{
  "name": "page",
  "in": "query",
  "required": false,
  "description": "页码,必须为非负数字字符串或数字;默认 1。",
  "schema": {
    "type": "integer",
    "minimum": 1,
    "default": 1,
    "example": 1
  }
}
limitqueryinteger可选

每页返回条数,必须为非负数字;默认 10。传 0 时不使用分页限制。

完整参数定义
{
  "name": "limit",
  "in": "query",
  "required": false,
  "description": "每页返回条数,必须为非负数字;默认 10。传 0 时不使用分页限制。",
  "schema": {
    "type": "integer",
    "minimum": 0,
    "default": 10,
    "example": 10
  }
}

响应

HTTP 200

查询成功时不含 msg 字段;参数或认证错误仍返回 HTTP 200。

application/json

oneOf

oneOf · 1 · object
字段类型必填说明与约束
codeinteger必填

业务状态码;0 表示成功。

约束 / 默认值 / 示例
{
  "enum": [
    0
  ]
}
countinteger必填

筛选后的套餐组总数,未受分页影响。

约束 / 默认值 / 示例
{
  "minimum": 0,
  "example": 2
}
dataarray <object>必填

当前页套餐组记录,按 sort 升序排列。

展开字段结构

当前页套餐组记录,按 sort 升序排列。

数组元素 · object
字段类型必填说明与约束
idinteger必填

套餐组 ID。

namestring必填

套餐组名称。

约束 / 默认值 / 示例
{
  "nullable": true
}
desstring必填

套餐组备注。

约束 / 默认值 / 示例
{
  "nullable": true
}
sortinteger必填

展示排序值,数值越小越靠前。

约束 / 默认值 / 示例
{
  "nullable": true
}
enableinteger必填

是否启用:1 为启用,0 为停用。

约束 / 默认值 / 示例
{
  "nullable": true,
  "enum": [
    0,
    1
  ]
}
create_atstring必填

创建时间,由数据库日期时间字段序列化返回。

约束 / 默认值 / 示例
{
  "nullable": true
}
update_atstring必填

最后更新时间,由数据库日期时间字段序列化返回;新建记录可能为 null。

约束 / 默认值 / 示例
{
  "nullable": true
}
oneOf · 2 · object
字段类型必填说明与约束
codestring必填

页码/分页条数格式错误或未登录时的业务错误码。

约束 / 默认值 / 示例
{
  "enum": [
    "package_group-4",
    "package_group-5",
    "login_required"
  ]
}
msgstring必填

错误原因。

约束 / 默认值 / 示例
{
  "example": "page参数格式不正确"
}
datastring必填

错误响应中的固定空字符串。

约束 / 默认值 / 示例
{
  "example": ""
}
完整 Schema
{
  "oneOf": [
    {
      "type": "object",
      "required": [
        "code",
        "count",
        "data"
      ],
      "properties": {
        "code": {
          "type": "integer",
          "enum": [
            0
          ],
          "description": "业务状态码;0 表示成功。"
        },
        "count": {
          "type": "integer",
          "minimum": 0,
          "description": "筛选后的套餐组总数,未受分页影响。",
          "example": 2
        },
        "data": {
          "type": "array",
          "description": "当前页套餐组记录,按 `sort` 升序排列。",
          "items": {
            "type": "object",
            "required": [
              "id",
              "name",
              "des",
              "sort",
              "enable",
              "create_at",
              "update_at"
            ],
            "properties": {
              "id": {
                "type": "integer",
                "description": "套餐组 ID。"
              },
              "name": {
                "type": "string",
                "nullable": true,
                "description": "套餐组名称。"
              },
              "des": {
                "type": "string",
                "nullable": true,
                "description": "套餐组备注。"
              },
              "sort": {
                "type": "integer",
                "nullable": true,
                "description": "展示排序值,数值越小越靠前。"
              },
              "enable": {
                "type": "integer",
                "nullable": true,
                "enum": [
                  0,
                  1
                ],
                "description": "是否启用:1 为启用,0 为停用。"
              },
              "create_at": {
                "type": "string",
                "nullable": true,
                "description": "创建时间,由数据库日期时间字段序列化返回。"
              },
              "update_at": {
                "type": "string",
                "nullable": true,
                "description": "最后更新时间,由数据库日期时间字段序列化返回;新建记录可能为 null。"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    {
      "type": "object",
      "required": [
        "code",
        "msg",
        "data"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "package_group-4",
            "package_group-5",
            "login_required"
          ],
          "description": "页码/分页条数格式错误或未登录时的业务错误码。"
        },
        "msg": {
          "type": "string",
          "description": "错误原因。",
          "example": "page参数格式不正确"
        },
        "data": {
          "type": "string",
          "description": "错误响应中的固定空字符串。",
          "example": ""
        }
      },
      "additionalProperties": false
    }
  ]
}

示例

{
  "code": 0,
  "count": 2,
  "data": [
    {
      "id": 3,
      "name": "标准套餐",
      "des": "适用于普通网站",
      "sort": 100,
      "enable": 1,
      "create_at": "Mon, 28 Jul 2026 10:30:00 GMT",
      "update_at": null
    }
  ]
}

查询成功

{
  "code": 0,
  "count": 2,
  "data": [
    {
      "id": 3,
      "name": "标准套餐",
      "des": "适用于普通网站",
      "sort": 100,
      "enable": 1,
      "create_at": "Mon, 28 Jul 2026 10:30:00 GMT",
      "update_at": null
    }
  ]
}

cURL 示例

根据文档生成;请替换主控地址、路径参数和凭证,并按上表补充查询参数。

curl --request GET \
  "https://master.example.invalid/v1/package-groups" \
  --header "access-token: YOUR_ACCESS_TOKEN"

查看完整接口 JSON