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

获取套餐组详情

GET/v1/package-groups/{group_id}

按 ID 获取套餐组详情。接口仅要求登录,查询时不按 enable 过滤,因此普通用户也可读取已停用套餐组的详情。

身份认证

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 同时发送。"
  }
}

请求参数

参数位置类型必填说明与约束
group_idpathinteger必填

套餐组 ID。

完整参数定义
{
  "name": "group_id",
  "in": "path",
  "required": true,
  "schema": {
    "type": "integer",
    "minimum": 1,
    "example": 3
  },
  "description": "套餐组 ID。"
}

响应

HTTP 200

成功、未登录和套餐组不存在均返回 HTTP 200。

application/json

oneOf

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

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

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

成功时为空字符串。

约束 / 默认值 / 示例
{
  "example": ""
}
dataobject必填

套餐组记录。

约束 / 默认值 / 示例
{
  "required": [
    "id",
    "name",
    "des",
    "sort",
    "enable",
    "create_at",
    "update_at"
  ],
  "additionalProperties": false
}
展开字段结构

套餐组记录。

字段类型必填说明与约束
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-3",
    "login_required"
  ]
}
msgstring必填

错误原因。

约束 / 默认值 / 示例
{
  "example": "套餐组不存在"
}
datastring必填

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

约束 / 默认值 / 示例
{
  "example": ""
}
完整 Schema
{
  "oneOf": [
    {
      "type": "object",
      "required": [
        "code",
        "msg",
        "data"
      ],
      "properties": {
        "code": {
          "type": "integer",
          "enum": [
            0
          ],
          "description": "业务状态码;0 表示成功。"
        },
        "msg": {
          "type": "string",
          "description": "成功时为空字符串。",
          "example": ""
        },
        "data": {
          "type": "object",
          "description": "套餐组记录。",
          "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-3",
            "login_required"
          ],
          "description": "套餐组不存在或未登录时的业务错误码。"
        },
        "msg": {
          "type": "string",
          "description": "错误原因。",
          "example": "套餐组不存在"
        },
        "data": {
          "type": "string",
          "description": "错误响应中的固定空字符串。",
          "example": ""
        }
      },
      "additionalProperties": false
    }
  ]
}

示例

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

查询成功

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

套餐组不存在

{
  "code": "package_group-3",
  "msg": "套餐组不存在",
  "data": ""
}

cURL 示例

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

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

查看完整接口 JSON