Merge branch 'refactor/visibility'
This commit is contained in:
8
src-tauri/src/services/cache/repo.rs
vendored
8
src-tauri/src/services/cache/repo.rs
vendored
@@ -45,7 +45,13 @@ pub trait CacheRepo: Send + Sync + 'static {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub struct CacheRepoImpl {
|
pub struct CacheRepoImpl {
|
||||||
pub db: DatabaseConnection,
|
db: DatabaseConnection,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CacheRepoImpl {
|
||||||
|
pub fn new(db: DatabaseConnection) -> Self {
|
||||||
|
Self { db }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
|
|||||||
2
src-tauri/src/services/cache/service.rs
vendored
2
src-tauri/src/services/cache/service.rs
vendored
@@ -53,7 +53,7 @@ impl CacheServiceImpl<super::repo::CacheRepoImpl> {
|
|||||||
pub fn new(db: DatabaseConnection) -> Self {
|
pub fn new(db: DatabaseConnection) -> Self {
|
||||||
Self {
|
Self {
|
||||||
db: db.clone(),
|
db: db.clone(),
|
||||||
repo: Arc::new(super::repo::CacheRepoImpl { db }),
|
repo: Arc::new(super::repo::CacheRepoImpl::new(db)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ use std::sync::Arc;
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
db::{
|
db::{
|
||||||
entities::category::{ActiveModel as CategoryActiveModel, Entity as CategoryEntity},
|
|
||||||
Db,
|
Db,
|
||||||
|
entities::category::{ActiveModel as CategoryActiveModel, Entity as CategoryEntity},
|
||||||
},
|
},
|
||||||
services::transaction::category::{
|
services::transaction::category::{
|
||||||
Category, CategoryServiceError, CategoryServiceResult, CategoryWithParent,
|
Category, CategoryServiceError, CategoryServiceResult, CategoryWithParent,
|
||||||
@@ -35,7 +35,13 @@ pub trait CategoryRepoService: Send + Sync + 'static {
|
|||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct CategoryRepoServiceImpl {
|
pub struct CategoryRepoServiceImpl {
|
||||||
pub db: DatabaseConnection,
|
db: DatabaseConnection,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CategoryRepoServiceImpl {
|
||||||
|
pub fn new(db: DatabaseConnection) -> Self {
|
||||||
|
Self { db }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct CategorySelfRefLink;
|
struct CategorySelfRefLink;
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ use thiserror::Error;
|
|||||||
use crate::{
|
use crate::{
|
||||||
db::{Db, DbServiceError},
|
db::{Db, DbServiceError},
|
||||||
services::transaction::category::{
|
services::transaction::category::{
|
||||||
repo::{CategoryRepoService, CategoryRepoServiceImpl},
|
|
||||||
Category, CategoryWithParent, CreateCategoryRequest, UpdateCategoryRequest,
|
Category, CategoryWithParent, CreateCategoryRequest, UpdateCategoryRequest,
|
||||||
|
repo::{CategoryRepoService, CategoryRepoServiceImpl},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ impl CategoryServiceImpl<CategoryRepoServiceImpl> {
|
|||||||
pub fn new(db: DatabaseConnection) -> Self {
|
pub fn new(db: DatabaseConnection) -> Self {
|
||||||
Self {
|
Self {
|
||||||
db: db.clone(),
|
db: db.clone(),
|
||||||
category_repo: Arc::new(CategoryRepoServiceImpl { db }),
|
category_repo: Arc::new(CategoryRepoServiceImpl::new(db)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
db::{
|
db::{
|
||||||
|
Db,
|
||||||
entities::{
|
entities::{
|
||||||
tag::{ActiveModel as TagActiveModel, Entity as TagEntity},
|
tag::{ActiveModel as TagActiveModel, Entity as TagEntity},
|
||||||
transaction_tag::{
|
transaction_tag::{
|
||||||
@@ -7,7 +8,6 @@ use crate::{
|
|||||||
Entity as TransactionTagEntity,
|
Entity as TransactionTagEntity,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Db,
|
|
||||||
},
|
},
|
||||||
services::transaction::tag::{
|
services::transaction::tag::{
|
||||||
CreateTagRequest, Tag, TagServiceError, TagServiceResult, UpdateTagRequest,
|
CreateTagRequest, Tag, TagServiceError, TagServiceResult, UpdateTagRequest,
|
||||||
@@ -45,7 +45,13 @@ pub trait TagRepoService: Send + Sync + 'static {
|
|||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct TagRepoServiceImpl {
|
pub struct TagRepoServiceImpl {
|
||||||
pub db: DatabaseConnection,
|
db: DatabaseConnection,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TagRepoServiceImpl {
|
||||||
|
pub fn new(db: DatabaseConnection) -> Self {
|
||||||
|
Self { db }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ use thiserror::Error;
|
|||||||
use crate::{
|
use crate::{
|
||||||
db::{Db, DbServiceError},
|
db::{Db, DbServiceError},
|
||||||
services::transaction::tag::{
|
services::transaction::tag::{
|
||||||
repo::{TagRepoService, TagRepoServiceImpl},
|
|
||||||
CreateTagRequest, Tag, UpdateTagRequest,
|
CreateTagRequest, Tag, UpdateTagRequest,
|
||||||
|
repo::{TagRepoService, TagRepoServiceImpl},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ impl TagServiceImpl<TagRepoServiceImpl> {
|
|||||||
pub fn new(db: DatabaseConnection) -> Self {
|
pub fn new(db: DatabaseConnection) -> Self {
|
||||||
Self {
|
Self {
|
||||||
db: db.clone(),
|
db: db.clone(),
|
||||||
tag_repo: Arc::new(TagRepoServiceImpl { db }),
|
tag_repo: Arc::new(TagRepoServiceImpl::new(db)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user