mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-07 17:18:10 +01:00
Rewrite to rust init
This commit is contained in:
24
src/serializers/author_annotation.rs
Normal file
24
src/serializers/author_annotation.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user