Skip to content

Commit 23d9a62

Browse files
authored
chore: plugin-request template (#273)
* chore: plugin-request template * fix: s3 upload prefix && file id to 8 length * fix: doc link
1 parent e832c80 commit 23d9a62

File tree

3 files changed

+45
-3
lines changed

3 files changed

+45
-3
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: FastGPT 官方文档
4+
url: https://doc.fastgpt.io/
5+
about: 查看 FastGPT 官方文档了解更多信息
6+
- name: FastGPT 飞书交流群
7+
url: https://oss.laf.run/otnvvf-imgs/fastgpt-feishu1.png
8+
about: 在社区中讨论 FastGPT 相关问题
9+
- name: 插件开发指南
10+
url: https://doc.fastgpt.io/docs/introduction/guide/plugins/dev_system_tool
11+
about: 查看 FastGPT 插件开发指南
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: 插件需求
3+
about: 提交 FastGPT 插件需求
4+
title: '[插件] 简要描述需求'
5+
labels: ['plugin']
6+
assignees: ''
7+
---
8+
9+
## 需求描述
10+
11+
需要实现什么插件功能?
12+
13+
## 使用场景
14+
15+
在什么情况下使用这个插件?
16+
17+
## 输入输出
18+
19+
- **输入**: 需要什么参数?
20+
- **输出**: 期望返回什么结果?
21+
22+
## 参考资料
23+
24+
相关文档或 API 接口:
25+
26+
## 补充说明
27+
28+
其他需要说明的信息:

lib/s3/controller.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export class S3Service {
130130
}
131131

132132
private generateFileId(): string {
133-
return randomBytes(16).toString('hex');
133+
return randomBytes(8).toString('hex');
134134
}
135135

136136
/**
@@ -248,8 +248,11 @@ export class S3Service {
248248
}
249249

250250
// const fileId = this.generateFileId();
251-
const prefix =
252-
(input.prefix?.endsWith('/') ? input.prefix : input.prefix + '/') ?? PluginBaseS3Prefix;
251+
const prefix = input.prefix
252+
? input.prefix?.endsWith('/')
253+
? input.prefix
254+
: input.prefix + '/'
255+
: PluginBaseS3Prefix;
253256
const objectName = `${prefix}${input.keepRawFilename ? '' : this.generateFileId() + '-'}${originalFilename}`;
254257
if (input.expireMins) {
255258
await MongoS3TTL.create({

0 commit comments

Comments
 (0)