mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 10:32:19 +00:00
Massive refactoring how DAV resources and routes work
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::Error;
|
||||
use actix_web::{web::Data, HttpRequest};
|
||||
use actix_web::{dev::ResourceMap, web::Data, HttpRequest};
|
||||
use async_trait::async_trait;
|
||||
use derive_more::derive::{From, Into};
|
||||
use rustical_dav::resource::{InvalidProperty, Resource, ResourceService};
|
||||
@@ -51,7 +51,11 @@ impl Resource for CalendarObjectResource {
|
||||
type Prop = CalendarObjectProp;
|
||||
type Error = Error;
|
||||
|
||||
fn get_prop(&self, _prefix: &str, prop: Self::PropName) -> Result<Self::Prop, Self::Error> {
|
||||
fn get_prop(
|
||||
&self,
|
||||
_rmap: &ResourceMap,
|
||||
prop: Self::PropName,
|
||||
) -> Result<Self::Prop, Self::Error> {
|
||||
Ok(match prop {
|
||||
CalendarObjectPropName::Getetag => CalendarObjectProp::Getetag(self.0.get_etag()),
|
||||
CalendarObjectPropName::CalendarData => {
|
||||
@@ -62,6 +66,11 @@ impl Resource for CalendarObjectResource {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn resource_name() -> &'static str {
|
||||
"caldav_calendar_object"
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait(?Send)]
|
||||
|
||||
Reference in New Issue
Block a user