跳转到内容
开发者文档 / 资源版本分支接口

更新版本分支

更新版本分支基础信息,并将版本、核心关联同步为请求体中的数组。

POST/api/resources/{resourceId}/releases/{resourceReleaseId}

鉴权方式 请求头 Api-Key、Api-Secret

Content-Type application/json

参数

位置参数类型必填说明
pathresourceIdinteger是资源 ID
pathresourceReleaseIdinteger是版本分支 ID
bodylabelstring建议是版本标签
bodytypestring建议是CLIENT、SERVER、BOTH
bodychannelstring否RELEASE、PREVIEW、BETA、ALPHA
bodynotesstring否Markdown 版本说明
bodyorderNuminteger否排序值
bodyversionsinteger[]是更新后的完整版本 ID 数组;清空时传 []
bodycoresinteger[]是更新后的完整核心 ID 数组;清空时传 []
bash
curl -X POST 'https://resource-api.xyeidc.com/api/resources/42/releases/649' \
  -H 'Api-Key: YOUR_API_KEY' \
  -H 'Api-Secret: YOUR_API_SECRET' \
  -H 'Content-Type: application/json' \
  -d '{
    "label": "1.0.1",
    "type": "CLIENT",
    "channel": "RELEASE",
    "notes": "修复已知问题",
    "orderNum": 1000,
    "versions": [419, 420],
    "cores": [25]
  }'

响应示例

json
{
  "code": 200,
  "msg": "Success!",
  "data": {
    "id": 649,
    "resourceId": 42,
    "label": "1.0.1",
    "type": "CLIENT",
    "channel": "RELEASE",
    "notes": "修复已知问题",
    "orderNum": 1000
  }
}

此接口按完整状态更新基础字段和关联集合。为避免将字段写为 null 或意外移除关联,请提交希望保留的完整值。

与创建版本分支不同,此接口不处理 links 数组,不能通过提交 links 来替换或清空下载地址。请分别调用创建下载地址、更新下载地址或删除下载地址。创建和更新单条链接时,displayType 均为必填字段。