-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(backend): add crate for lock service
- Loading branch information
Showing
8 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[package] | ||
name = "lock-service" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
async-graphql = { workspace = true } | ||
chrono = { workspace = true } | ||
common-models = { path = "../../models/common" } | ||
common-utils = { path = "../../utils/common" } | ||
config = { path = "../../config" } | ||
database-models = { path = "../../models/database" } | ||
dependent-models = { path = "../../models/dependent" } | ||
env-utils = { path = "../../utils/env" } | ||
sea-orm = { workspace = true } | ||
sea-query = { workspace = true } | ||
serde = { workspace = true } | ||
serde_json = { workspace = true } | ||
sqlx = { workspace = true } | ||
tracing = { workspace = true } | ||
uuid = { workspace = true } | ||
|
||
[package.metadata.cargo-machete] | ||
ignored = ["serde", "tracing"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use async_graphql::Result; | ||
use common_models::ApplicationCacheKey; | ||
use sea_orm::DatabaseConnection; | ||
|
||
pub struct LockService { | ||
db: DatabaseConnection, | ||
} | ||
|
||
impl LockService { | ||
pub fn new(db: &DatabaseConnection) -> Self { | ||
Self { db: db.clone() } | ||
} | ||
} | ||
|
||
impl LockService { | ||
pub async fn acquire_lock(&self, key: ApplicationCacheKey) -> Result<bool> { | ||
todo!() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters