pub struct OssDto {
pub id: Option<i32>,
pub filename: String,
pub file_ext: Option<String>,
pub object_key: Option<String>,
pub url: Option<String>,
pub episode_id: i32,
pub post_name: String,
}Expand description
OSS 文件传输对象
封装单次文件上传/下载所需的信息。 包含文件名、对象存储 Key、关联的话数 ID 和岗位名称。
§字段说明
| 字段 | 数据库列 | 说明 |
|---|---|---|
id | id | 自增主键,插入前为 None |
filename | filename | 原始文件名(含后缀) |
file_ext | fileExt | 文件后缀,用于 Content-Type 匹配 |
object_key | objectKey | COS 上的对象路径 Key |
url | url | 下载 URL(CDN 鉴权或 COS 预签名) |
episode_id | episodeId | 关联的话数 ID |
post_name | postName | 岗位英文名,如 “translator”、“proofreader” |
§序列化
JSON 格式(camelCase),用于文件上传回调的请求体。
§对应 Java 类
Java OssDTO。
Fields§
§id: Option<i32>OSS 记录主键,新增时为 None
filename: String原始文件名(含后缀)
file_ext: Option<String>文件后缀,如 “jpg”、“7z”
object_key: Option<String>COS 对象 Key(存储路径)
url: Option<String>下载 URL(CDN 鉴权或 COS 预签名)
episode_id: i32关联的话数 ID
post_name: String岗位英文名(translator / proofreader / letterer / timer)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for OssDto
impl<'de> Deserialize<'de> for OssDto
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for OssDto
impl RefUnwindSafe for OssDto
impl Send for OssDto
impl Sync for OssDto
impl Unpin for OssDto
impl UnsafeUnpin for OssDto
impl UnwindSafe for OssDto
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request