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]]
name = "bichon"
version = "0.2.2"
version = "0.2.3"
dependencies = [
"ahash",
"async-imap",
+4 -1
View File
@@ -1,12 +1,15 @@
[package]
name = "bichon"
version = "0.2.2"
version = "0.2.3"
edition = "2021"
[[bin]]
name = "bichon"
path = "src/main.rs"
[[bin]]
name = "bichon-cli"
path = "src/bin/bichon_cli.rs"
[features]
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
// along with this program. If not, see <http://www.gnu.org/licenses/>.
use mimalloc::MiMalloc;
use modules::{
common::rustls::RustMailerTls,
context::{executors::EmailClientExecutors, Initialize},
error::BichonResult,
logger,
rest::start_http_server,
tasks::PeriodicTasks,
use bichon::{
bichon_version,
modules::{
common::rustls::RustMailerTls,
context::{executors::EmailClientExecutors, Initialize},
error::BichonResult,
logger,
rest::start_http_server,
tasks::PeriodicTasks,
},
};
use mimalloc::MiMalloc;
use tracing::info;
use crate::modules::{
use bichon::modules::{
common::signal::SignalManager, settings::dir::DataDirManager, users::manager::UserManager,
};
mod modules;
#[global_allocator]
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
// along with this program. If not, see <http://www.gnu.org/licenses/>.
use crate::modules::error::BichonResult;
pub mod controller;
pub mod executors;
pub mod status;
#[allow(async_fn_in_trait)]
pub trait Initialize {
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
// along with this program. If not, see <http://www.gnu.org/licenses/>.
use crate::logger::file::setup_file_logger;
use crate::modules::logger::file::setup_file_logger;
use crate::modules::settings::cli::SETTINGS;
use chrono::Local;
use std::process;
+1
View File
@@ -19,6 +19,7 @@
pub mod account;
pub mod autoconfig;
pub mod cache;
pub mod cli;
pub mod common;
pub mod context;
pub mod dashboard;
+2 -2
View File
@@ -22,7 +22,7 @@ use serde::{Deserialize, Serialize};
use crate::modules::{
database::{list_all_impl, manager::DB_MANAGER},
error::BichonResult,
users::BichonUser,
users::UserModel,
};
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, Object)]
@@ -34,7 +34,7 @@ pub struct MinimalUser {
impl 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
.into_iter()
.map(|user| MinimalUser {
+1 -1
View File
@@ -469,7 +469,7 @@ impl BichonUserV2 {
delete_impl(DB_MANAGER.meta_db(), move |rw| {
rw.get()
.primary::<BichonUser>(id)
.primary::<UserModel>(id)
.map_err(|e| raise_error!(format!("{:#?}", e), ErrorCode::InternalError))?
.ok_or_else(|| {
raise_error!(