Initial commit
This commit is contained in:
commit
dccfa2d4cf
19 changed files with 3156 additions and 0 deletions
23
app/Cargo.toml
Normal file
23
app/Cargo.toml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
[package]
|
||||
name = "app"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies.rest]
|
||||
path = "../rest"
|
||||
|
||||
[dependencies.service_impl]
|
||||
path = "../service_impl"
|
||||
|
||||
[dependencies.dao_impl]
|
||||
path = "../dao_impl"
|
||||
|
||||
[dependencies.tokio]
|
||||
version = "1.37.0"
|
||||
features = ["full"]
|
||||
|
||||
[dependencies.sqlx]
|
||||
version = "0.7.4"
|
||||
features = ["runtime-tokio", "sqlite"]
|
||||
19
app/src/main.rs
Normal file
19
app/src/main.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let pool = Arc::new(
|
||||
SqlitePool::connect("sqlite:./localdb.sqlite3")
|
||||
.await
|
||||
.expect("Could not connect to database"),
|
||||
);
|
||||
let hello_dao = dao_impl::HelloDaoImpl::new(pool.clone());
|
||||
let permission_dao = dao_impl::PermissionDaoImpl::new(pool);
|
||||
|
||||
let permission_service = service_impl::PermissionServiceImpl::new(permission_dao.into());
|
||||
let hello_service =
|
||||
service_impl::HelloServiceImpl::new(hello_dao.into(), permission_service.into());
|
||||
rest::start_server(hello_service).await
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue