1
This commit is contained in:
parent
de5f2e0033
commit
4185e7aa31
@ -1 +1,3 @@
|
||||
pub mod user_app;
|
||||
|
||||
pub use user_app::UserApp;
|
||||
|
@ -3,6 +3,8 @@ use std::cell::RefCell;
|
||||
use r9_macro::SharedFromSelf;
|
||||
use r9_macro_derive::SharedFromSelf;
|
||||
use r9_macro_derive::Singleton;
|
||||
use f9::app::App;
|
||||
use f9::app::HttpContext;
|
||||
|
||||
#[derive(SharedFromSelf)]
|
||||
#[derive(Singleton)]
|
||||
@ -13,11 +15,26 @@ pub struct UserApp {
|
||||
impl f9::app::UserApp for UserApp {
|
||||
|
||||
fn get_pkg_name(&self) -> String {
|
||||
return "".to_string();
|
||||
return "statserver".to_string();
|
||||
}
|
||||
|
||||
fn init(&mut self) {
|
||||
|
||||
App::instance().borrow_mut().add_http_handler(
|
||||
"Ops$selfChecking".to_string(),
|
||||
Box::new(
|
||||
move |ctx: &mut HttpContext| {
|
||||
ctx.rsp = "Ops$selfChecking".to_string();
|
||||
}
|
||||
),
|
||||
);
|
||||
App::instance().borrow_mut().add_http_handler(
|
||||
"Ops$selfChecking1".to_string(),
|
||||
Box::new(
|
||||
move |ctx: &mut HttpContext| {
|
||||
ctx.rsp = "Ops$selfChecking1".to_string();
|
||||
}
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
fn update(&mut self) {
|
||||
@ -28,6 +45,10 @@ impl f9::app::UserApp for UserApp {
|
||||
|
||||
}
|
||||
|
||||
fn get_http_listen_port(&self) -> i32 {
|
||||
return 8080;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl UserApp {
|
||||
|
@ -1,7 +1,7 @@
|
||||
use f9::app::App;
|
||||
|
||||
mod app;
|
||||
use crate::app::user_app::UserApp;
|
||||
use crate::app::UserApp;
|
||||
|
||||
fn main() {
|
||||
App::instance().borrow_mut().init(UserApp::instance());
|
||||
|
2
third_party/librust
vendored
2
third_party/librust
vendored
@ -1 +1 @@
|
||||
Subproject commit d371216ec4d299af7f7aa68d033941f8006328a1
|
||||
Subproject commit 0e4b8daa3498ac0e75475b05f36d2a363098ca81
|
Loading…
x
Reference in New Issue
Block a user