pub struct OssFileApiClient {
pub api_client: CrudApiClient,
}Expand description
OSS FILE API
Fields§
§api_client: CrudApiClientImplementations§
Source§impl OssFileApiClient
impl OssFileApiClient
Sourcepub async fn upload_file(
&self,
bucket: &str,
file_path: &str,
file_name: &str,
current_user_id: u64,
) -> Result<Ro<Value>, ApiClientError>
pub async fn upload_file( &self, bucket: &str, file_path: &str, file_name: &str, current_user_id: u64, ) -> Result<Ro<Value>, ApiClientError>
Sourcepub async fn upload_file_content(
&self,
bucket: &str,
file_name: &str,
data: Vec<u8>,
current_user_id: u64,
) -> Result<Ro<Value>, ApiClientError>
pub async fn upload_file_content( &self, bucket: &str, file_name: &str, data: Vec<u8>, current_user_id: u64, ) -> Result<Ro<Value>, ApiClientError>
Sourcepub async fn download_file(
&self,
obj_id: impl Display,
current_user_id: u64,
) -> Result<Vec<u8>, ApiClientError>
pub async fn download_file( &self, obj_id: impl Display, current_user_id: u64, ) -> Result<Vec<u8>, ApiClientError>
Methods from Deref<Target = CrudApiClient>§
Sourcepub async fn get(
&self,
path: &str,
current_user_id: u64,
) -> Result<Ro<Value>, ApiClientError>
pub async fn get( &self, path: &str, current_user_id: u64, ) -> Result<Ro<Value>, ApiClientError>
执行GET请求的通用方法
Sourcepub async fn get_bytes(
&self,
path: &str,
current_user_id: u64,
) -> Result<Vec<u8>, ApiClientError>
pub async fn get_bytes( &self, path: &str, current_user_id: u64, ) -> Result<Vec<u8>, ApiClientError>
执行GET请求的通用方法,返回bytes
Sourcepub async fn post<B>(
&self,
path: &str,
body: &B,
current_user_id: u64,
) -> Result<Ro<Value>, ApiClientError>
pub async fn post<B>( &self, path: &str, body: &B, current_user_id: u64, ) -> Result<Ro<Value>, ApiClientError>
执行POST请求的通用方法
Sourcepub async fn put<B>(
&self,
path: &str,
body: &B,
current_user_id: u64,
) -> Result<Ro<Value>, ApiClientError>
pub async fn put<B>( &self, path: &str, body: &B, current_user_id: u64, ) -> Result<Ro<Value>, ApiClientError>
执行PUT请求的通用方法
Trait Implementations§
Source§impl Debug for OssFileApiClient
impl Debug for OssFileApiClient
Source§impl Deref for OssFileApiClient
impl Deref for OssFileApiClient
Auto Trait Implementations§
impl Freeze for OssFileApiClient
impl RefUnwindSafe for OssFileApiClient
impl Send for OssFileApiClient
impl Sync for OssFileApiClient
impl Unpin for OssFileApiClient
impl UnwindSafe for OssFileApiClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more