Skip to content

Conversation

xqvvu
Copy link
Contributor

@xqvvu xqvvu commented Oct 10, 2025

No description provided.

Copy link
Contributor

gru-agent bot commented Oct 10, 2025

There is too much information in the pull request to test.

Copy link

github-actions bot commented Oct 10, 2025

Preview mcp_server Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_mcp_server_9dbb27048a5ec9e8967b51dd5db54c383dab1568

Copy link

Preview fastgpt Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_34cdcbdfd780b4448ed56c0ebec865d4b459ac4e

Copy link
Collaborator

@c121914yu c121914yu left a 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({
Copy link
Collaborator

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);
Copy link
Collaborator

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;
Copy link
Collaborator

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(
Copy link
Collaborator

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);
Copy link
Collaborator

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> {
Copy link
Collaborator

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(
Copy link
Collaborator

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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants