init
This commit is contained in:
@@ -1,17 +1,25 @@
|
||||
use crate::models::category;
|
||||
use crate::domain::dto::category::{
|
||||
CategoryResponse, CreateCategoryRequest, UpdateCategoryRequest,
|
||||
};
|
||||
use crate::models::category;
|
||||
use sea_orm::Set;
|
||||
use uuid::Uuid;
|
||||
|
||||
pub fn category_model_to_category_response(model: category::Model) -> CategoryResponse {
|
||||
category_model_to_category_response_with_permission(model, None)
|
||||
}
|
||||
|
||||
pub fn category_model_to_category_response_with_permission(
|
||||
model: category::Model,
|
||||
permission: Option<u64>,
|
||||
) -> CategoryResponse {
|
||||
CategoryResponse {
|
||||
id: model.id,
|
||||
server_id: model.server_id,
|
||||
name: model.name,
|
||||
created_at: model.created_at,
|
||||
updated_at: model.updated_at,
|
||||
permission,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user