feat: 添加 sendOss 函数和文件流读取路由,支持文件发送功能
This commit is contained in:
@@ -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) => {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user