This commit is contained in:
likun 2024-07-16 20:32:32 +08:00
parent a57dd55785
commit 74680b91b5
10 changed files with 15 additions and 7 deletions

View File

@ -2,5 +2,5 @@ mod service;
mod server; mod server;
pub fn boot() { pub fn boot() {
start_server(); server::start_server();
} }

View File

@ -1,5 +1,5 @@
mod server; mod server;
pub fn start_server() { pub fn start_server() {
server::start_server() server::start_server();
} }

View File

@ -6,6 +6,10 @@ async fn greet(name: web::Path<String>) -> impl Responder {
} }
pub fn test_start_server() {
println!("test start account server")
}
pub fn start_server() -> std::io::Result<()> { pub fn start_server() -> std::io::Result<()> {
HttpServer::new(|| { HttpServer::new(|| {
App::new().service(greet) App::new().service(greet)

2
src/apps/mod.rs Normal file
View File

@ -0,0 +1,2 @@
pub mod account;
pub mod order;

View File

@ -1,5 +1,6 @@
use crate::apps::account as account; use crate::apps::account as account;
fn start_apps() { fn start_apps() {
account::boot() account::boot()
} }

1
src/bin/mod.rs Normal file
View File

@ -0,0 +1 @@
pub mod all_in_one;

View File

@ -1,2 +0,0 @@
pub mod all_in_one;
use apps::account;

View File

@ -1,7 +1,9 @@
use crate::account;
use apps::account; pub mod apps;
pub mod bin;
use crate::apps::account;
#[actix_web::main] // or #[tokio::main] #[actix_web::main] // or #[tokio::main]
async fn main() -> std::io::Result<()> { async fn main() -> std::io::Result<()> {
println!("Hello, world!"); bin::all_in_one::boot();
} }