puerto 0.10.0

Puerto — Rust full-stack DDD framework CLI. Scaffolds Clean Architecture projects with auto-wired DI, SQLx support, and zero manual wiring. Formerly puerto-framework.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use business::domain::greeting::model::Greeting;
use poem_openapi::Object;

#[derive(Object, Debug)]
#[oai(rename_all = "camelCase")]
pub struct GreetingDto {
    pub name: String,
    pub message: String,
}

impl GreetingDto {
    pub fn from_greeting(greeting: &Greeting) -> Self {
        Self {
            name: greeting.name.clone(),
            message: greeting.message.clone(),
        }
    }
}