feat: category crud
This commit is contained in:
14
src/util/req.rs
Normal file
14
src/util/req.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use axum::http::StatusCode;
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct CommonResp {
|
||||
pub code: i64,
|
||||
}
|
||||
|
||||
pub fn internal_error<E>(err: E) -> (StatusCode, String)
|
||||
where
|
||||
E: std::error::Error,
|
||||
{
|
||||
(StatusCode::INTERNAL_SERVER_ERROR, err.to_string())
|
||||
}
|
||||
Reference in New Issue
Block a user