feat: add image upload functionality for articles

- Implemented image upload API in the article service, allowing users to upload images associated with articles.
- Added validation for image size and type, ensuring only supported formats (PNG, JPG, GIF, WebP) are accepted.
- Created a new Aliyun object storage client to handle image storage and retrieval.
- Updated the article handler to include an endpoint for image uploads.
- Enhanced error handling for image upload failures and added relevant error messages.
- Introduced public URL generation for stored images, allowing access via signed tokens.
- Updated localization files to include new messages related to image upload functionality.
- Added tests for image upload and retrieval processes.
This commit is contained in:
2026-04-05 22:10:05 +08:00
parent 1401b50556
commit 94f7186cce
19 changed files with 1033 additions and 14 deletions
@@ -406,6 +406,10 @@ const enUS = {
coverHint: "Upload a cover asset before publishing. This is local preview only for now.",
coverUpload: "Upload cover image",
imagePrompt: "Enter image URL",
tablePicker: {
empty: "Drag to choose a table size",
hint: "Keep dragging near the edge to expand the grid",
},
messages: {
saved: "Article saved.",
generating: "This article is still generating. Try editing it later.",
@@ -413,6 +413,10 @@ const zhCN = {
coverHint: "发布前可先上传封面素材,当前只做本地预览。",
coverUpload: "上传封面图",
imagePrompt: "请输入图片地址",
tablePicker: {
empty: "拖拽选择表格尺寸",
hint: "按住拖动到边缘可继续扩展",
},
messages: {
saved: "文章已保存",
generating: "文章还在生成中,请稍后再编辑。",