object_storage_sdk/
storage.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use serde;
use serde::{Deserialize, Serialize};
use tihu::Api;
use tihu::LightString;

#[derive(Serialize, Deserialize, Debug)]
pub struct GetReq {
    pub key: String,
}

pub const UPLOAD_API: &str = "/api/oss/upload";

/**
 * 删除
 */
pub const DELETE_API: &str = "/api/oss/delete";
#[derive(Serialize, Deserialize, Debug)]
pub struct DeleteReq {
    pub key: String,
}

pub type DeleteResp = bool;
pub struct DeleteApi;
impl Api for DeleteApi {
    type Input = DeleteReq;
    type Output = DeleteResp;
    fn namespace() -> LightString {
        return LightString::from_static(DELETE_API);
    }
}