separate signer.

fix ilm feature.
This commit is contained in:
likewu
2025-06-28 11:02:37 +08:00
parent e4690c48b4
commit 4ed84a6bc4
54 changed files with 498 additions and 1200 deletions
+9 -9
View File
@@ -1,10 +1,10 @@
use http::status::StatusCode;
use std::fmt::{self, Display, Formatter};
#[derive(Default, thiserror::Error, Debug, PartialEq)]
#[derive(Default, thiserror::Error, Debug, Clone, PartialEq)]
pub struct AdminError {
pub code: &'static str,
pub message: &'static str,
pub code: String,
pub message: String,
pub status_code: StatusCode,
}
@@ -15,18 +15,18 @@ impl Display for AdminError {
}
impl AdminError {
pub fn new(code: &'static str, message: &'static str, status_code: StatusCode) -> Self {
pub fn new(code: &str, message: &str, status_code: StatusCode) -> Self {
Self {
code,
message,
code: code.to_string(),
message: message.to_string(),
status_code,
}
}
pub fn msg(message: &'static str) -> Self {
pub fn msg(message: &str) -> Self {
Self {
code: "InternalError",
message,
code: "InternalError".to_string(),
message: message.to_string(),
status_code: StatusCode::INTERNAL_SERVER_ERROR,
}
}