feat: pagination

This commit is contained in:
Maulana Sodiqin
2025-03-26 13:06:34 +07:00
parent 8e12c79ea6
commit 9d92a9a136
15 changed files with 573 additions and 61 deletions
+15
View File
@@ -12,6 +12,9 @@ use crate::{
#[utoipa::path(
get,
security(
("Bearer" = [])
),
path = "/v1/roles",
params(
("page" = Option<i64>, Query, description = "Page number"),
@@ -36,6 +39,9 @@ pub async fn get_role_list(
#[utoipa::path(
get,
security(
("Bearer" = [])
),
path = "/v1/roles/detail/{id}",
params(("id" = String, Path, description = "Role ID")),
responses(
@@ -52,6 +58,9 @@ pub async fn get_role_by_id(
#[utoipa::path(
post,
security(
("Bearer" = [])
),
path = "/v1/roles/create",
request_body = RolesRequestCreateDto,
responses(
@@ -68,6 +77,9 @@ pub async fn post_create_role(
#[utoipa::path(
put,
security(
("Bearer" = [])
),
path = "/v1/roles/update/{id}",
request_body = RolesRequestUpdateDto,
responses(
@@ -85,6 +97,9 @@ pub async fn put_update_role(
#[utoipa::path(
delete,
security(
("Bearer" = [])
),
path = "/v1/roles/delete/{id}",
responses(
(status = 200, description = "Delete role", body = MessageResponseDto)
+1
View File
@@ -45,6 +45,7 @@ impl<'a> RolesRepository<'a> {
&ResourceEnum::Roles.to_string(),
&meta,
conditions,
None,
)
.await
}