use std::collections::{HashMap, HashSet};
use serde::{Deserialize, Serialize};
use crate::{
error::ApiErrorItem,
ty::{ApiModel, ApiTy},
};
// 响应参数
#[derive(Debug, Default, Serialize, Deserialize)]
pub struct ApiResponse {
// 响应头参数
pub header: Vec<ApiTy>,
// 内容类型
pub content_type: Option<String>,
// 响应体参数
pub body: Option<ApiTy>,
// 错误列表
pub error: HashSet<ApiErrorItem>,
}
pub trait ApiResultExtractor {
fn api_response(models: &mut HashMap<String, Option<ApiModel>>) -> ApiResponse;
fn api_error() -> Vec<ApiErrorItem>;
}