实现附件上传与下载
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Stale
- Domain
- backend-api-design
Research direction
Read the designs in issues #2 and #3 and resolve dependency #13 first. Start with the internal/storage interface, then implement local storage and the upload and download endpoints described here. Done means tenant-scoped access, configured size and type checks, SHA-256 storage, timeline association, integration tests, and synchronized OpenAPI; pull request #22 is already open.
Written by the indexing model from the issue text.
Description
Background
工单附件用于报障截图、现场照片等。设计见 #2(表)、#3(端点)。P0 本地磁盘存储,S3 等对象存储 P2 再接。
Technical requirement
POST /api/tickets/:id/attachments:multipart 上传;单文件默认上限 20MB(配置项);类型白名单:png / jpeg / webp / gif / pdf / zip / txt(配置项扩展);- 计算并落库
sha256;存储路径data/uploads/{tenant_id}/{yyyy-MM}/{ulid或雪花id}{ext},文件名不由用户输入决定,杜绝路径穿越; GET /api/attachments/:id/content:鉴权(租户内;requester 仅自己的工单),带Content-Disposition与正确的Content-Type;- 与 timeline 关联:上传成功可选携带
timeline_id,或自动追加systemkind 记录; - 存储层抽象为接口(
internal/storage),本地实现 + 接口测试,便于 P2 增加 S3 实现; - 上传与下载均计入租户 scope(跨租户 404)。
Expect
- 集成测试:超限 / 非白名单类型被拒;跨租户下载 404;路径穿越样例文件名被安全化;
- OpenAPI 同步。
Potential TODO list
- storage 接口 + 本地实现
- 上传端点(校验、sha256、路径生成)
- 下载端点(鉴权、Disposition)
- timeline 关联
- 集成测试
依赖
#13。
- Dominant language
- No language data
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from LinuxSuRen/tick-flow
-
项目门面:logo、README 与仓库 AboutPossibly taken @linuxsuren-fs claimed this 9 days ago. Opendocumentation good first issue help wanted P0
Difficulty 4/5 3-5 days Newbie friendliness 20/100
LinuxSuRen/tick-flow#20 ·
-
编写四个内置种子模板包Possibly taken @linuxsuren-fs claimed this 9 days ago. Opengood first issue help wanted P0
Difficulty 4/5 3-5 days Newbie friendliness 35/100
LinuxSuRen/tick-flow#19 ·
-
实现处理工作台前端:列表、详情与处理动作Possibly taken @linuxsuren-fs claimed this 9 days ago. Openhelp wanted P0
Difficulty 5/5 Over a week Newbie friendliness 25/100
LinuxSuRen/tick-flow#18 ·
-
实现提交门户前端:表单渲染器与我的工单Possibly taken @linuxsuren-fs claimed this 9 days ago. Openhelp wanted P0
Difficulty 4/5 3-5 days Newbie friendliness 25/100
LinuxSuRen/tick-flow#17 ·
-
实现站内通知与邮件通知Possibly taken @linuxsuren-fs claimed this 9 days ago. Openhelp wanted P0
Difficulty 4/5 3-5 days Newbie friendliness 25/100
LinuxSuRen/tick-flow#16 ·
All issues in LinuxSuRen/tick-flow
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
vetro-protocol/vetro-monorepo#1262 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ProyectoRespira/respira-webapp#334 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100