feat: wire relay API with dependency injection

- split settings module into per-struct files
- add DatabaseSettings with default in-memory SQLite path
- implement RelayApi struct with GET /relays and POST
  /relays/{id}/toggle
- wire create_relay_controller and create_label_repository into
  Application::build() with mock/real selection via cfg!(test) || CI
- register RelayApi in OpenApiService alongside existing APIs
This commit is contained in:
2026-03-04 12:47:21 +01:00
parent fd00d1925b
commit 2eebc52f17
30 changed files with 1170 additions and 670 deletions

View File

@@ -126,10 +126,7 @@ mod tests {
let dto = RelayDto::from(relay);
let json = serde_json::to_string(&dto).unwrap();
assert_eq!(
json,
r#"{"id":7,"state":"on","label":"Test Relay"}"#
);
assert_eq!(json, r#"{"id":7,"state":"on","label":"Test Relay"}"#);
}
#[test]