Skip to content

Commit 2e82cd8

Browse files
committed
Update file.md
补全了file原始的两个API文档,增加了一个新的API
1 parent ed0a6fe commit 2e82cd8

1 file changed

Lines changed: 40 additions & 1 deletion

File tree

src/api/v1/file.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,16 @@ POST /v1/file/send
2121
{
2222
"userId": "123", // 目标用户ID
2323
"deviceId": "123", // 目标用户指定分享的设备ID,为空则为发送给目标用户的所有设备
24-
"fileData": "{}" // 文件分享数据,格式为json转义,json转义准确格式未完成
24+
"fileData": "{}" // 文件分享数据,格式为json转义,以下为fileData转义部分格式
25+
// {
26+
// "path": "C:\\Windows\\test.exe", // 文件原始目录
27+
// "size": 5774088, // 文件大小
28+
// "name": "test.exe", // 文件名称
29+
// "isDirectory": 0, // 未知
30+
// "count": 1, // 未知
31+
// "current": 1, // 未知
32+
// "uuid": "123123123123123123" // 文件分享uuid,应该是随机的,可以随便写
33+
// }
2534
}
2635
```
2736

@@ -63,3 +72,33 @@ POST /v1/file/reply
6372
"msg": "success" // 返回消息
6473
}
6574
```
75+
76+
## 建立超级文件分享
77+
78+
POST /v1/file/offer
79+
80+
请求头:
81+
82+
|名称|必须|备注|
83+
|-----|-----|-----|
84+
|token|||
85+
86+
请求体:
87+
88+
```JSONC
89+
{
90+
"deviceId": "123", // 目标用户指定分享的设备ID
91+
"description": "{}", // 连接协议,为json格式数据转义,未完成
92+
"userId": "123", //目标用户ID
93+
"sessionId": "123123123123123123123" // 连接请求标识ID,应该是随机的,可以随便写
94+
}
95+
```
96+
97+
响应体:
98+
99+
```JSONC
100+
{
101+
"code": 1, // 请求状态码,1为正常
102+
"msg": "success" // 返回消息
103+
}
104+
```

0 commit comments

Comments
 (0)