presentation wiring
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,3 +4,5 @@ version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
async-trait = { workspace = true }
|
||||
domain = { workspace = true }
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
pub fn add(left: u64, right: u64) -> u64 {
|
||||
left + right
|
||||
}
|
||||
use async_trait::async_trait;
|
||||
use domain::{errors::DomainError, ports::AuthService, value_objects::UserId};
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
pub struct StubAuthService;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = add(2, 2);
|
||||
assert_eq!(result, 4);
|
||||
#[async_trait]
|
||||
impl AuthService for StubAuthService {
|
||||
async fn validate_token(&self, _token: &str) -> Result<UserId, DomainError> {
|
||||
Err(DomainError::InfrastructureError(
|
||||
"auth service not implemented".into(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,4 +9,4 @@ askama = { version = "0.16.0" }
|
||||
serde = { workspace = true }
|
||||
|
||||
domain = { workspace = true }
|
||||
presentation = { workspace = true }
|
||||
application = { workspace = true }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use askama::Template;
|
||||
use application::ports::HtmlRenderer;
|
||||
use domain::models::{DiaryEntry, collections::Paginated};
|
||||
use presentation::ports::HtmlRenderer; // Assuming you exposed the port
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "diary.html")]
|
||||
|
||||
Reference in New Issue
Block a user