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:
@@ -273,6 +273,13 @@ export interface UpdateArticleRequest {
|
||||
platforms?: string[];
|
||||
}
|
||||
|
||||
export interface ArticleImageUploadResponse {
|
||||
url: string;
|
||||
object_key: string;
|
||||
content_type: string;
|
||||
size_bytes: number;
|
||||
}
|
||||
|
||||
export interface ArticleVersion {
|
||||
id: number;
|
||||
version_no: number;
|
||||
|
||||
Reference in New Issue
Block a user