1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Hash)]
pub struct ApiErrorItem {
    // http状态
    pub status: u16,

    // 错误标识
    pub code: String,

    // 错误原因
    pub cause: String,
}

pub trait ApiErrors {
    fn api_errors() -> Vec<ApiErrorItem>;
}