BLOG-104 feat: add URI format to preview_image_url in request and response DTOs; remove maximum constraints from color DTOs
This commit is contained in:
parent
d69482116c
commit
451951f22a
1
backend/Cargo.lock
generated
1
backend/Cargo.lock
generated
@ -3537,6 +3537,7 @@ dependencies = [
|
||||
"quote",
|
||||
"regex",
|
||||
"syn",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -30,7 +30,11 @@ sqlx = { version = "0.8.5", features = [
|
||||
"runtime-tokio-rustls",
|
||||
] }
|
||||
tokio = { version = "1.45.0", features = ["full"] }
|
||||
utoipa = { version = "5.4.0", features = ["actix_extras"] }
|
||||
utoipa = { version = "5.4.0", features = [
|
||||
"actix_extras",
|
||||
"non_strict_integers",
|
||||
"url",
|
||||
] }
|
||||
utoipa-redoc = { version = "6.0.0", features = ["actix-web"] }
|
||||
|
||||
server.path = "server"
|
||||
|
@ -7,6 +7,8 @@ use crate::domain::entity::user::User;
|
||||
pub struct UserResponseDto {
|
||||
pub id: i32,
|
||||
pub displayed_name: String,
|
||||
|
||||
#[schema(format = Email)]
|
||||
pub email: String,
|
||||
}
|
||||
|
||||
|
@ -5,16 +5,9 @@ use crate::domain::entity::color::Color;
|
||||
|
||||
#[derive(Deserialize, ToSchema)]
|
||||
pub struct ColorRequestDto {
|
||||
#[schema(maximum = 255)]
|
||||
pub red: u8,
|
||||
|
||||
#[schema(maximum = 255)]
|
||||
pub green: u8,
|
||||
|
||||
#[schema(maximum = 255)]
|
||||
pub blue: u8,
|
||||
|
||||
#[schema(maximum = 255)]
|
||||
pub alpha: u8,
|
||||
}
|
||||
|
||||
|
@ -5,16 +5,9 @@ use crate::domain::entity::color::Color;
|
||||
|
||||
#[derive(Serialize, ToSchema)]
|
||||
pub struct ColorResponseDto {
|
||||
#[schema(maximum = 255)]
|
||||
pub red: u8,
|
||||
|
||||
#[schema(maximum = 255)]
|
||||
pub green: u8,
|
||||
|
||||
#[schema(maximum = 255)]
|
||||
pub blue: u8,
|
||||
|
||||
#[schema(maximum = 255)]
|
||||
pub alpha: u8,
|
||||
}
|
||||
|
||||
|
@ -8,10 +8,12 @@ use crate::domain::entity::{post::Post, post_info::PostInfo};
|
||||
pub struct CreatePostRequestDto {
|
||||
pub title: String,
|
||||
pub description: String,
|
||||
pub preview_image_url: String,
|
||||
pub content: String,
|
||||
pub label_ids: Vec<i32>,
|
||||
|
||||
#[schema(format = Uri)]
|
||||
pub preview_image_url: String,
|
||||
|
||||
#[schema(required, format = DateTime)]
|
||||
pub published_time: Option<String>,
|
||||
}
|
||||
|
@ -10,9 +10,11 @@ pub struct PostInfoResponseDto {
|
||||
pub id: i32,
|
||||
pub title: String,
|
||||
pub description: String,
|
||||
pub preview_image_url: String,
|
||||
pub labels: Vec<LabelResponseDto>,
|
||||
|
||||
#[schema(format = Uri)]
|
||||
pub preview_image_url: String,
|
||||
|
||||
#[schema(format = DateTime)]
|
||||
pub published_time: Option<String>,
|
||||
}
|
||||
|
@ -8,10 +8,12 @@ use crate::domain::entity::{post::Post, post_info::PostInfo};
|
||||
pub struct UpdatePostRequestDto {
|
||||
pub title: String,
|
||||
pub description: String,
|
||||
pub preview_image_url: String,
|
||||
pub content: String,
|
||||
pub label_ids: Vec<i32>,
|
||||
|
||||
#[schema(format = Uri)]
|
||||
pub preview_image_url: String,
|
||||
|
||||
#[schema(required, format = DateTime)]
|
||||
pub published_time: Option<String>,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user