Skip to content

Commit

Permalink
Fix build errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmiegit committed Sep 18, 2024
1 parent 4ba1c34 commit 6ba1e87
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions deepwell/src/endpoints/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::services::blob::BlobService;
use crate::services::file::{
DeleteFile, DeleteFileOutput, EditFile, EditFileOutput, GetBlobOutput,
GetFileDetails, GetFileOutput, MoveFile, MoveFileOutput, RestoreFile,
RestoreFileOutput,
RestoreFileOutput, StartFileUploadOutput,
};
use crate::services::Result;
use crate::web::{Bytes, FileDetails};
Expand Down Expand Up @@ -82,7 +82,7 @@ pub async fn file_get(
pub async fn file_upload(
ctx: &ServiceContext<'_>,
params: Params<'static>,
) -> Result<UploadFileOutput> {
) -> Result<StartFileUploadOutput> {
// FIXME file upload endpoint
/*
let input: UploadFile = params.parse()?;
Expand Down
1 change: 1 addition & 0 deletions deepwell/src/services/blob/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ impl BlobService {
hash: EMPTY_BLOB_HASH,
mime: str!(EMPTY_BLOB_MIME),
size: 0,
created: false,
});
}

Expand Down
4 changes: 2 additions & 2 deletions deepwell/src/services/file/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::services::blob::{FinalizeBlobUploadOutput, EMPTY_BLOB_HASH, EMPTY_BLO
use crate::services::file_revision::{
CreateFileRevision, CreateFileRevisionBody, CreateFirstFileRevision,
CreatePendingFileRevision, CreateResurrectionFileRevision,
CreateTombstoneFileRevision, FileBlob,
CreateTombstoneFileRevision, FileBlob, FinishFileRevisionUpload,
};
use crate::services::filter::{FilterClass, FilterType};
use crate::services::{BlobService, FileRevisionService, FilterService};
Expand Down Expand Up @@ -147,7 +147,7 @@ impl FileService {
// This gets the data from BlobService and then deletes the row.
FileRevisionService::finish_upload(
ctx,
FinishUploadFile {
FinishFileRevisionUpload {
site_id,
page_id,
file_id,
Expand Down
5 changes: 4 additions & 1 deletion deepwell/src/services/file/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

use crate::models::sea_orm_active_enums::FileRevisionType;
use crate::services::file_revision::{
CreateFileRevisionOutput, CreateFirstFileRevisionOutput, FinishFileRevisionUploadOutput,
CreateFileRevisionOutput, CreateFirstFileRevisionOutput,
FinishFileRevisionUploadOutput,
};
use crate::web::{Bytes, FileDetails, ProvidedValue, Reference};
use serde_json::Value as JsonValue;
Expand Down Expand Up @@ -67,6 +68,8 @@ pub struct UploadFileEdit {

pub type UploadFileEditOutput = CreateFileRevisionOutput;

pub type FinishUploadFileEdit = FinishUploadFile;

#[derive(Deserialize, Debug, Clone)]
pub struct GetFile<'a> {
pub site_id: i64,
Expand Down
2 changes: 1 addition & 1 deletion deepwell/src/services/file_revision/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use crate::models::file_revision::{
};
use crate::services::blob::{FinalizeBlobUploadOutput, EMPTY_BLOB_HASH, EMPTY_BLOB_MIME};
use crate::services::{BlobService, OutdateService, PageService};
use crate::web::FetchDirection;
use crate::web::{Bytes, FetchDirection};
use once_cell::sync::Lazy;
use std::num::NonZeroI32;

Expand Down
6 changes: 3 additions & 3 deletions deepwell/src/services/file_revision/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use super::prelude::*;
use crate::hash::BlobHash;
use crate::services::page_revision::PageRevisionCountOutput;
use crate::web::FetchDirection;
use crate::web::{Bytes, FetchDirection};

#[derive(Debug, Clone)]
pub struct CreateFileRevision {
Expand Down Expand Up @@ -131,11 +131,11 @@ pub struct FinishFileRevisionUpload {
pub pending_blob_id: i64,
}

#[derive(Serialize, Debug, Copy, Clone)]
#[derive(Serialize, Debug, Clone)]
pub struct FinishFileRevisionUploadOutput {
pub file_id: i64,
pub file_revision_id: i64,
pub s3_hash: Bytes,
pub s3_hash: Bytes<'static>,
pub mime_hint: String,
pub size_hint: i64,
pub created: bool,
Expand Down

0 comments on commit 6ba1e87

Please sign in to comment.