This commit is contained in:
rustmailer
2026-01-01 20:28:23 +08:00
parent b2e43b0907
commit 09375ee11c
11 changed files with 25 additions and 19 deletions
Generated
+1 -1
View File
@@ -424,7 +424,7 @@ dependencies = [
[[package]] [[package]]
name = "bichon" name = "bichon"
version = "0.2.2" version = "0.2.3"
dependencies = [ dependencies = [
"ahash", "ahash",
"async-imap", "async-imap",
+4 -1
View File
@@ -1,12 +1,15 @@
[package] [package]
name = "bichon" name = "bichon"
version = "0.2.2" version = "0.2.3"
edition = "2021" edition = "2021"
[[bin]] [[bin]]
name = "bichon" name = "bichon"
path = "src/main.rs" path = "src/main.rs"
[[bin]]
name = "bichon-cli"
path = "src/bin/bichon_cli.rs"
[features] [features]
default = [] default = []
+1
View File
@@ -0,0 +1 @@
fn main() {}
+1
View File
@@ -0,0 +1 @@
pub mod modules;
+12 -11
View File
@@ -16,23 +16,24 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
use mimalloc::MiMalloc; use bichon::{
use modules::{ bichon_version,
common::rustls::RustMailerTls, modules::{
context::{executors::EmailClientExecutors, Initialize}, common::rustls::RustMailerTls,
error::BichonResult, context::{executors::EmailClientExecutors, Initialize},
logger, error::BichonResult,
rest::start_http_server, logger,
tasks::PeriodicTasks, rest::start_http_server,
tasks::PeriodicTasks,
},
}; };
use mimalloc::MiMalloc;
use tracing::info; use tracing::info;
use crate::modules::{ use bichon::modules::{
common::signal::SignalManager, settings::dir::DataDirManager, users::manager::UserManager, common::signal::SignalManager, settings::dir::DataDirManager, users::manager::UserManager,
}; };
mod modules;
#[global_allocator] #[global_allocator]
static GLOBAL: MiMalloc = MiMalloc; static GLOBAL: MiMalloc = MiMalloc;
View File
+1 -1
View File
@@ -16,13 +16,13 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
use crate::modules::error::BichonResult; use crate::modules::error::BichonResult;
pub mod controller; pub mod controller;
pub mod executors; pub mod executors;
pub mod status; pub mod status;
#[allow(async_fn_in_trait)]
pub trait Initialize { pub trait Initialize {
async fn initialize() -> BichonResult<()>; async fn initialize() -> BichonResult<()>;
} }
+1 -2
View File
@@ -16,8 +16,7 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
use crate::modules::logger::file::setup_file_logger;
use crate::logger::file::setup_file_logger;
use crate::modules::settings::cli::SETTINGS; use crate::modules::settings::cli::SETTINGS;
use chrono::Local; use chrono::Local;
use std::process; use std::process;
+1
View File
@@ -19,6 +19,7 @@
pub mod account; pub mod account;
pub mod autoconfig; pub mod autoconfig;
pub mod cache; pub mod cache;
pub mod cli;
pub mod common; pub mod common;
pub mod context; pub mod context;
pub mod dashboard; pub mod dashboard;
+2 -2
View File
@@ -22,7 +22,7 @@ use serde::{Deserialize, Serialize};
use crate::modules::{ use crate::modules::{
database::{list_all_impl, manager::DB_MANAGER}, database::{list_all_impl, manager::DB_MANAGER},
error::BichonResult, error::BichonResult,
users::BichonUser, users::UserModel,
}; };
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Object)] #[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Object)]
@@ -34,7 +34,7 @@ pub struct MinimalUser {
impl MinimalUser { impl MinimalUser {
pub async fn list_all() -> BichonResult<Vec<MinimalUser>> { pub async fn list_all() -> BichonResult<Vec<MinimalUser>> {
let all_users = list_all_impl::<BichonUser>(DB_MANAGER.meta_db()).await?; let all_users = list_all_impl::<UserModel>(DB_MANAGER.meta_db()).await?;
let minimal_list = all_users let minimal_list = all_users
.into_iter() .into_iter()
.map(|user| MinimalUser { .map(|user| MinimalUser {
+1 -1
View File
@@ -469,7 +469,7 @@ impl BichonUserV2 {
delete_impl(DB_MANAGER.meta_db(), move |rw| { delete_impl(DB_MANAGER.meta_db(), move |rw| {
rw.get() rw.get()
.primary::<BichonUser>(id) .primary::<UserModel>(id)
.map_err(|e| raise_error!(format!("{:#?}", e), ErrorCode::InternalError))? .map_err(|e| raise_error!(format!("{:#?}", e), ErrorCode::InternalError))?
.ok_or_else(|| { .ok_or_else(|| {
raise_error!( raise_error!(