even more renames

This commit is contained in:
Kasisnu committed 2025-04-03 21:02:37 +05:30
1 parent 74971e9a9a
commit a92185b5ea
3 files changed
+11 -11

No files matched your search

@@ -1 +1 @@
pub mod upload_image_media_file_handler;
pub mod upload_snapshot_media_file_handler;
@@ -37,10 +37,10 @@ use crate::util::check_creator_tokens::{check_creator_tokens, CheckCreatorTokenA
/// Form-multipart request fields.
///
/// IF VIEWING DOCS, PLEASE SEE BOTTOM OF PAGE `UploadImageMediaFileForm` (Under "Schema") FOR DETAILS ON FIELDS AND NULLABILITY.
/// IF VIEWING DOCS, PLEASE SEE BOTTOM OF PAGE `UploadSnapshotMediaFileForm` (Under "Schema") FOR DETAILS ON FIELDS AND NULLABILITY.
#[derive(MultipartForm, ToSchema)]
#[multipart(duplicate_field = "deny")]
pub struct UploadImageMediaFileForm {
pub struct UploadSnapshotMediaFileForm {
/// UUID for request idempotency
#[multipart(limit = "2 KiB")]
#[schema(value_type = String, format = Binary)]
@@ -69,7 +69,7 @@ pub struct UploadImageMediaFileForm {
// Unlike the "upload" endpoints, which are pure inserts, these endpoints are *upserts*.
#[derive(Serialize, ToSchema)]
pub struct UploadImageMediaFileSuccessResponse {
pub struct UploadSnapshotMediaFileSuccessResponse {
pub success: bool,
pub media_file_token: MediaFileToken,
}
@@ -89,7 +89,7 @@ static ALLOWED_MIME_TYPES : Lazy<HashSet<&'static str>> = Lazy::new(|| {
tag = "Media Files (Upload)",
path = "/v1/image_studio/scene_snapshot",
responses(
(status = 200, description = "Success Update", body = UploadImageMediaFileSuccessResponse),
(status = 200, description = "Success Update", body = UploadSnapshotMediaFileSuccessResponse),
(status = 400, description = "Bad input", body = MediaFileUploadError),
(status = 401, description = "Not authorized", body = MediaFileUploadError),
(status = 429, description = "Too many requests", body = MediaFileUploadError),
@@ -97,16 +97,16 @@ static ALLOWED_MIME_TYPES : Lazy<HashSet<&'static str>> = Lazy::new(|| {
),
params(
(
"request" = UploadImageMediaFileForm,
description = "IF VIEWING DOCS, PLEASE SEE BOTTOM OF PAGE `UploadImageMediaFileForm` (Under 'Schema') FOR DETAILS ON FIELDS AND NULLABILITY."
"request" = UploadSnapshotMediaFileForm,
description = "IF VIEWING DOCS, PLEASE SEE BOTTOM OF PAGE `UploadSnapshotMediaFileForm` (Under 'Schema') FOR DETAILS ON FIELDS AND NULLABILITY."
),
)
)]
pub async fn upload_studio_scene_snapshot_handler(
http_request: HttpRequest,
server_state: web::Data<Arc<ServerState>>,
MultipartForm(mut form): MultipartForm<UploadImageMediaFileForm>,
) -> Result<Json<UploadImageMediaFileSuccessResponse>, MediaFileUploadError> {
MultipartForm(mut form): MultipartForm<UploadSnapshotMediaFileForm>,
) -> Result<Json<UploadSnapshotMediaFileSuccessResponse>, MediaFileUploadError> {
let mut mysql_connection = server_state.mysql_pool
.acquire()
@@ -290,7 +290,7 @@ pub async fn upload_studio_scene_snapshot_handler(
info!("new media file id: {} token: {:?}", record_id, &token);
Ok(Json(UploadImageMediaFileSuccessResponse {
Ok(Json(UploadSnapshotMediaFileSuccessResponse {
success: true,
media_file_token: token,
}))
@@ -1,5 +1,5 @@
use crate::http_server::endpoints::image_studio::prompt::enqueue_studio_image_generation::enqueue_studio_image_generation_request;
use crate::http_server::endpoints::image_studio::upload::upload_image_media_file_handler::upload_studio_scene_snapshot_handler;
use crate::http_server::endpoints::image_studio::upload::upload_snapshot_media_file_handler::upload_studio_scene_snapshot_handler;
use actix_http::body::MessageBody;
use actix_service::ServiceFactory;
use actix_web::dev::{ServiceRequest, ServiceResponse};