mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-06 15:15:36 +01:00
25 lines
506 B
Rust
25 lines
506 B
Rust
use serde::Serialize;
|
|
|
|
use crate::prisma::author_annotation;
|
|
|
|
#[derive(Serialize)]
|
|
pub struct AuthorAnnotation {
|
|
pub id: i32,
|
|
pub title: String,
|
|
pub text: String,
|
|
pub file: Option<String>
|
|
}
|
|
|
|
impl From<author_annotation::Data> for AuthorAnnotation {
|
|
fn from(val: author_annotation::Data) -> Self {
|
|
let author_annotation::Data { id, title, text, file, .. } = val;
|
|
|
|
AuthorAnnotation {
|
|
id,
|
|
title,
|
|
text,
|
|
file
|
|
}
|
|
}
|
|
}
|