feat: 添加 sendOss 函数和文件流读取路由,支持文件发送功能

This commit is contained in:
2026-03-30 21:46:15 +08:00
parent 5b0a68ad67
commit 67ebed8d73
2 changed files with 46 additions and 0 deletions

View File

@@ -391,3 +391,20 @@ export const aiProxy = async (req: IncomingMessage, res: ServerResponse, opts: P
return getAiProxy(req, res, opts);
};
type SendOssOptions = {
/**
* 文件路径,必须
* 例如:/root/resources/demo/1.0.0/readme.md
*/
filepath: string;
user?: {
username?: string;
id?: string;
}
}
// TODO: 这个函数需要重构,应该放在一个独立的模块中,需要完善权限校验等功能,单实现文件发送功能
export const sendOss = async (res: ServerResponse, opts: SendOssOptions) => {
}