Update CurseForge API documentation

This commit is contained in:
CPTProgrammer
2026-07-13 16:18:52 +08:00
parent 750f2a18f8
commit b778ebc1d8
4 changed files with 1053 additions and 10 deletions
+111 -10
View File
@@ -49,10 +49,10 @@ GET https://api.curseforge.com/v1/mods/{modId}/files
"isAvailable": true, // 是否可下载
"displayName": "My Mod v1.0", // 显示名称
"fileName": "my-mod-1.0.jar", // 文件名
"releaseType": 1, // 1=Release, 2=Beta, 3=Alpha
"fileStatus": 10, // 文件状态(见附表)
"releaseType": 1, // FileReleaseType
"fileStatus": 10, // FileStatus
"hashes": [
{ "value": "abc123...", "algo": 1 } // algo: 1=Sha1, 2=Md5
{ "value": "abc123...", "algo": 1 } // FileHash
],
"fileDate": "2025-01-01T00:00:00Z", // 文件时间戳
"fileLength": 1048576, // 文件大小(字节)
@@ -72,7 +72,7 @@ GET https://api.curseforge.com/v1/mods/{modId}/files
"dependencies": [ // 依赖关系
{
"modId": 123, // 依赖的项目 ID
"relationType": 3 // 关系类型(见附表)
"relationType": 3 // FileRelationType
}
],
"exposeAsAlternative": false,
@@ -97,11 +97,9 @@ GET https://api.curseforge.com/v1/mods/{modId}/files
}
```
---
### 枚举值
## 附表
### releaseType
**FileReleaseType**
| 值 | 含义 |
|----|------|
@@ -109,7 +107,7 @@ GET https://api.curseforge.com/v1/mods/{modId}/files
| 2 | Beta |
| 3 | Alpha |
### relationType
**FileRelationType**
| 值 | 含义 |
|----|------|
@@ -120,11 +118,114 @@ GET https://api.curseforge.com/v1/mods/{modId}/files
| 5 | Incompatible |
| 6 | Include |
### fileStatus(常用值)
**FileStatus**
| 值 | 含义 |
|----|------|
| 1 | Processing |
| 2 | ChangesRequired |
| 3 | UnderReview |
| 4 | Approved |
| 5 | Rejected |
| 6 | MalwareDetected |
| 7 | Deleted |
| 8 | Archived |
| 9 | Testing |
| 10 | Released |
| 11 | ReadyForReview |
| 12 | Deprecated |
| 13 | Baking |
| 14 | AwaitingPublishing |
| 15 | FailedPublishing |
| 16 | Cooking |
| 17 | Cooked |
| 18 | UnderManualReview |
| 19 | ScanningForMalware |
| 20 | ProcessingFile |
| 21 | PendingRelease |
| 22 | ReadyForCooking |
| 23 | PostProcessing |
**HashAlgo**
| 值 | 含义 |
|----|------|
| 1 | Sha1 |
| 2 | Md5 |
---
## Schemas
### File
响应中 `data[]` 的元素类型。
| 字段 | 类型 | 说明 |
|------|------|------|
| `id` | int32 | 文件 ID |
| `gameId` | int32 | 所属游戏 ID |
| `modId` | int32 | 所属项目 ID |
| `isAvailable` | boolean | 是否可下载 |
| `displayName` | string | 显示名称 |
| `fileName` | string | 文件名 |
| `releaseType` | FileReleaseType | 发布类型 |
| `fileStatus` | FileStatus | 文件状态 |
| `hashes` | FileHash[] | 文件哈希列表 |
| `fileDate` | string(date-time) | 文件时间戳 |
| `fileLength` | int64 | 文件大小(字节) |
| `downloadCount` | int64 | 下载次数 |
| `fileSizeOnDisk` | int64 \| null | 磁盘占用 |
| `downloadUrl` | string | 下载地址 |
| `gameVersions` | string[] | 关联的游戏版本字符串列表 |
| `sortableGameVersions` | SortableGameVersion[] | 排序用版本信息 |
| `dependencies` | FileDependency[] | 依赖关系 |
| `exposeAsAlternative` | boolean \| null | 是否暴露为替代版本 |
| `parentProjectFileId` | int32 \| null | 父项目文件 ID |
| `alternateFileId` | int32 \| null | 替代文件 ID |
| `isServerPack` | boolean \| null | 是否为服务端包 |
| `serverPackFileId` | int32 \| null | 服务端包文件 ID |
| `isEarlyAccessContent` | boolean \| null | 是否为抢先体验内容 |
| `earlyAccessEndDate` | string(date-time) \| null | 抢先体验结束日期 |
| `fileFingerprint` | int64 | 文件指纹 |
| `modules` | FileModule[] | 文件模块列表 |
### FileHash
| 字段 | 类型 | 说明 |
|------|------|------|
| `value` | string | 哈希值 |
| `algo` | int | 哈希算法(见 HashAlgo 枚举) |
### FileDependency
| 字段 | 类型 | 说明 |
|------|------|------|
| `modId` | int32 | 依赖的项目 ID |
| `relationType` | int | 关系类型(见 FileRelationType 枚举) |
### FileModule
| 字段 | 类型 | 说明 |
|------|------|------|
| `name` | string | 模块名 |
| `fingerprint` | int64 | 模块指纹 |
### SortableGameVersion
| 字段 | 类型 | 说明 |
|------|------|------|
| `gameVersionName` | string | 原始版本名(如 `1.5b` |
| `gameVersionPadded` | string | 补齐版本号(如 `0000000001.0000000005`),用于排序 |
| `gameVersion` | string | 清洗后的版本号(如 `1.5` |
| `gameVersionReleaseDate` | string(date-time) | 版本发布日期 |
| `gameVersionTypeId` | int32 \| null | 游戏版本类型 ID |
### Pagination
| 字段 | 类型 | 说明 |
|------|------|------|
| `index` | int32 | 本次返回的起始索引(从 0 开始) |
| `pageSize` | int32 | 请求的页大小 |
| `resultCount` | int32 | 本次实际返回数量 |
| `totalCount` | int64 | 符合条件的总数量 |