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,5 +1,8 @@
|
|||
use mongodb::{
|
||||
bson::{doc, oid::ObjectId, DateTime},
|
||||
Collection,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use mongodb::{bson::{doc, oid::ObjectId, DateTime}, Collection};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Family {
|
||||
|
|
@ -29,13 +32,16 @@ impl FamilyRepository {
|
|||
pub fn new(collection: Collection<Family>) -> Self {
|
||||
Self { collection }
|
||||
}
|
||||
|
||||
|
||||
pub async fn create(&self, family: &Family) -> mongodb::error::Result<()> {
|
||||
self.collection.insert_one(family, None).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn find_by_family_id(&self, family_id: &str) -> mongodb::error::Result<Option<Family>> {
|
||||
|
||||
pub async fn find_by_family_id(
|
||||
&self,
|
||||
family_id: &str,
|
||||
) -> mongodb::error::Result<Option<Family>> {
|
||||
self.collection
|
||||
.find_one(doc! { "familyId": family_id }, None)
|
||||
.await
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue