Expose new analytics data in backend route (#5982)
* Expose more analytics data in backend * Adjust fetch analytics body * fix * fix
This commit is contained in:
@@ -33,7 +33,16 @@ pub struct Download {
|
||||
|
||||
/// Why a project was downloaded.
|
||||
#[derive(
|
||||
Debug, Display, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize,
|
||||
Debug,
|
||||
Display,
|
||||
Clone,
|
||||
Copy,
|
||||
PartialEq,
|
||||
Eq,
|
||||
Hash,
|
||||
Serialize,
|
||||
Deserialize,
|
||||
utoipa::ToSchema,
|
||||
)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[display(rename_all = "snake_case")]
|
||||
@@ -47,6 +56,15 @@ pub enum DownloadReason {
|
||||
Modpack,
|
||||
}
|
||||
|
||||
impl std::str::FromStr for DownloadReason {
|
||||
type Err = ();
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
serde_json::from_value(serde_json::Value::String(s.to_string()))
|
||||
.map_err(|_| ())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Row, Serialize, Deserialize, Clone, Eq, PartialEq, Hash)]
|
||||
pub struct PageView {
|
||||
pub recorded: i64,
|
||||
|
||||
Reference in New Issue
Block a user