请求体
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
resourceTypeId | integer | 是 | 资源类型 ID |
name | string | 是 | 资源名称 |
englishName | string | 否 | 英文名称 |
identify | string | 否 | 资源唯一标识,使用字母、数字 1–9、-、_ |
language | string | 否 | 资源语言 |
description | string | 是 | 简短介绍 |
text | string | 否 | Markdown 长介绍 |
customTags | string[] | 否 | 自定义标签数组 |
tags | integer[] | 否 | 平台标签 ID 数组 |
setting | object | 否 | 展示、下载与讨论设置 |
meta | object | 否 | 来源、许可、开源和反馈信息 |
setting 可包含 view、original、hasServer、enablePost、enableRewardDownload、loginDownload。meta 可包含 source、sourceUrl、videoUrl、recommendConfig、license、openSourceUrl、issueUrl。
curl -X POST 'https://resource-api.xyeidc.com/api/resources' \
-H 'Api-Key: YOUR_API_KEY' \
-H 'Api-Secret: YOUR_API_SECRET' \
-H 'Content-Type: application/json' \
-d '{
"resourceTypeId": 4,
"name": "Example Mod",
"englishName": "Example Mod",
"identify": "example-mod",
"language": "zh-CN",
"description": "一个精简的示例资源",
"text": "## 介绍\n这是资源详情。",
"customTags": ["冒险", "实用"],
"tags": [16, 17],
"setting": {
"view": true,
"original": true,
"hasServer": false,
"enablePost": true,
"enableRewardDownload": false,
"loginDownload": true
},
"meta": {
"source": "原创",
"license": "MIT",
"openSourceUrl": "https://github.com/example/example-mod",
"issueUrl": "https://github.com/example/example-mod/issues"
}
}'
响应示例
{
"code": 200,
"msg": "Success!",
"data": {
"id": 42,
"resourceTypeId": 4,
"memberId": 10001,
"name": "Example Mod",
"identify": "example-mod",
"description": "一个精简的示例资源"
}
}
verified、archived 和部分推荐设置受管理员权限控制,普通开发者不应依赖在创建请求中修改这些字段。
