style: apply rustfmt to backend codebase
- Apply rustfmt to all Rust source files in backend/ - Fix trailing whitespace inconsistencies - Standardize formatting across handlers, models, and services - Improve code readability with consistent formatting These changes are purely stylistic and do not affect functionality. All CI checks now pass with proper formatting.
This commit is contained in:
parent
6b7e4d4016
commit
ee0feb77ef
41 changed files with 1266 additions and 819 deletions
|
|
@ -1,10 +1,10 @@
|
|||
use mongodb::{
|
||||
Collection,
|
||||
bson::{doc, oid::ObjectId},
|
||||
};
|
||||
use futures::stream::TryStreamExt;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use futures::stream::TryStreamExt;
|
||||
use mongodb::{
|
||||
bson::{doc, oid::ObjectId},
|
||||
Collection,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub enum AuditEventType {
|
||||
|
|
@ -87,7 +87,8 @@ impl AuditLogRepository {
|
|||
}
|
||||
|
||||
pub async fn find_by_user(&self, user_id: &ObjectId) -> Result<Vec<AuditLog>> {
|
||||
let cursor = self.collection
|
||||
let cursor = self
|
||||
.collection
|
||||
.find(
|
||||
doc! {
|
||||
"user_id": user_id
|
||||
|
|
@ -102,15 +103,13 @@ impl AuditLogRepository {
|
|||
|
||||
pub async fn find_recent(&self, limit: u64) -> Result<Vec<AuditLog>> {
|
||||
use mongodb::options::FindOptions;
|
||||
|
||||
|
||||
let opts = FindOptions::builder()
|
||||
.sort(doc! { "timestamp": -1 })
|
||||
.limit(limit as i64)
|
||||
.build();
|
||||
|
||||
let cursor = self.collection
|
||||
.find(doc! {}, opts)
|
||||
.await?;
|
||||
let cursor = self.collection.find(doc! {}, opts).await?;
|
||||
|
||||
let logs: Vec<AuditLog> = cursor.try_collect().await?;
|
||||
Ok(logs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue