提交
This commit is contained in:
parent
536c959e3e
commit
a57dd55785
@ -1,3 +1,4 @@
|
|||||||
|
workspace = { members = ["apps/account/domain/repo"] }
|
||||||
[package]
|
[package]
|
||||||
name = "sold"
|
name = "sold"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@ -6,3 +7,4 @@ edition = "2021"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
actix-web = "4"
|
||||||
|
0
src/apps/account/domain/entity/mod.rs
Normal file
0
src/apps/account/domain/entity/mod.rs
Normal file
0
src/apps/account/domain/repo/mod.rs
Normal file
0
src/apps/account/domain/repo/mod.rs
Normal file
0
src/apps/account/domain/service/mod.rs
Normal file
0
src/apps/account/domain/service/mod.rs
Normal file
6
src/apps/account/mod.rs
Normal file
6
src/apps/account/mod.rs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
mod service;
|
||||||
|
mod server;
|
||||||
|
|
||||||
|
pub fn boot() {
|
||||||
|
start_server();
|
||||||
|
}
|
5
src/apps/account/server/mod.rs
Normal file
5
src/apps/account/server/mod.rs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
mod server;
|
||||||
|
|
||||||
|
pub fn start_server() {
|
||||||
|
server::start_server()
|
||||||
|
}
|
16
src/apps/account/server/server.rs
Normal file
16
src/apps/account/server/server.rs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
use actix_web::{get, web, App, HttpServer, Responder};
|
||||||
|
|
||||||
|
#[get("/hello/{name}")]
|
||||||
|
async fn greet(name: web::Path<String>) -> impl Responder {
|
||||||
|
format!("Hello {name}!")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
pub fn start_server() -> std::io::Result<()> {
|
||||||
|
HttpServer::new(|| {
|
||||||
|
App::new().service(greet)
|
||||||
|
})
|
||||||
|
.bind(("127.0.0.1", 8080))?
|
||||||
|
.run()
|
||||||
|
.await
|
||||||
|
}
|
1
src/apps/account/service/mod.rs
Normal file
1
src/apps/account/service/mod.rs
Normal file
@ -0,0 +1 @@
|
|||||||
|
mod service;
|
0
src/apps/account/service/service.rs
Normal file
0
src/apps/account/service/service.rs
Normal file
0
src/apps/order/api/order.pb
Normal file
0
src/apps/order/api/order.pb
Normal file
0
src/apps/order/domain/entity/entity.rs
Normal file
0
src/apps/order/domain/entity/entity.rs
Normal file
0
src/apps/order/domain/repo/repo.rs
Normal file
0
src/apps/order/domain/repo/repo.rs
Normal file
0
src/apps/order/domain/service/service.rs
Normal file
0
src/apps/order/domain/service/service.rs
Normal file
0
src/apps/order/mod.rs
Normal file
0
src/apps/order/mod.rs
Normal file
0
src/apps/order/server/http.rs
Normal file
0
src/apps/order/server/http.rs
Normal file
0
src/apps/order/server/mod.rs
Normal file
0
src/apps/order/server/mod.rs
Normal file
0
src/apps/order/server/server.rs
Normal file
0
src/apps/order/server/server.rs
Normal file
0
src/apps/order/service/mod.rs
Normal file
0
src/apps/order/service/mod.rs
Normal file
0
src/apps/order/service/service.rs
Normal file
0
src/apps/order/service/service.rs
Normal file
5
src/cmd/all_in_one/boot.rs
Normal file
5
src/cmd/all_in_one/boot.rs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
use crate::apps::account as account;
|
||||||
|
|
||||||
|
fn start_apps() {
|
||||||
|
account::boot()
|
||||||
|
}
|
1
src/cmd/all_in_one/mod.rs
Normal file
1
src/cmd/all_in_one/mod.rs
Normal file
@ -0,0 +1 @@
|
|||||||
|
pub mod boot;
|
2
src/lib.rs
Normal file
2
src/lib.rs
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
pub mod all_in_one;
|
||||||
|
use apps::account;
|
@ -1,3 +1,7 @@
|
|||||||
fn main() {
|
use crate::account;
|
||||||
|
use apps::account;
|
||||||
|
|
||||||
|
#[actix_web::main] // or #[tokio::main]
|
||||||
|
async fn main() -> std::io::Result<()> {
|
||||||
println!("Hello, world!");
|
println!("Hello, world!");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user