-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Feat/minio #5748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feat/minio #5748
Conversation
There is too much information in the pull request to test. |
Preview mcp_server Image:
|
Preview fastgpt Image:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
简化下,不要都过度封装
export const S3Sources = S3SourcesSchema.enum; | ||
export type S3SourceType = z.infer<typeof S3SourcesSchema>; | ||
|
||
export const CreateObjectKeyParamsSchema = z.object({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DDD 写法,别集中声明
async move(src: string, dst: string, options?: CopyConditions): Promise<void> { | ||
const bucket = this.name; | ||
await this.client.copyObject(bucket, dst, `/${bucket}/${src}`, options); | ||
await this.delete(src); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
失败了如何回退
public options: Partial<S3Options> = defaultS3Options | ||
) { | ||
options = { ...defaultS3Options, ...options }; | ||
this.options = options as S3Options; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.options = { ...defaultS3Options, ...options }
this.client = new Client(this.options)
* @param options the options for the s3 client | ||
* @param afterInits the function to be called after instantiating the s3 service | ||
*/ | ||
constructor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
超过 2 个参数,用对象格式 {}
// set bucket lifecycle | ||
async () => { | ||
const bucket = this.name; | ||
await this.client.setBucketLifecycle(bucket, lifecycleOfTemporaryAvatars); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try catch
await this.bucket.delete(avatarObjectKey); | ||
} | ||
|
||
async moveAvatarFromTemp(tempAvatarWithPrefix: string): Promise<string> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接存最终路径
protected bucket: T; | ||
protected static instances: Map<string, S3BaseSource> = new Map(); | ||
|
||
constructor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用对象
visibility: params.visibility | ||
}); | ||
|
||
const { formData, postURL } = await this.client.presignedPostPolicy(policy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.