SquidSpirit d58a7d1a37
All checks were successful
Frontend CI / build (push) Successful in 1m9s
BLOG-78 feat: implement image upload and retrieval feature
This commit introduces the capability to upload and serve images.

A new `image` feature module has been added to the backend, following the existing clean architecture pattern.

- Implements `POST /image/upload` for uploading image files.
- Implements `GET /image/{id}` for retrieving an image by its ID.
- Adds a new `image` table to the database to store image metadata.
- Image data is stored in the file system. The path can be configured via the `STORAGE_PATH` environment variable.
2025-07-27 11:51:41 +08:00

10 lines
326 B
Rust

use async_trait::async_trait;
use crate::{application::error::image_error::ImageError, domain::entity::image::Image};
#[async_trait]
pub trait ImageRepository: Send + Sync {
async fn save_image(&self, image: Image) -> Result<i32, ImageError>;
async fn get_image_by_id(&self, id: i32) -> Result<Image, ImageError>;
}