accounts and config: add user list api, configurate swagger docs

This commit is contained in:
behruz
2025-12-11 15:40:18 +05:00
parent 19cc0dbb9c
commit 4174bd06b8
8 changed files with 266 additions and 5 deletions

View File

@@ -4,4 +4,6 @@ REST_FRAMEWORK = {
'rest_framework.authentication.BasicAuthentication',
'rest_framework_simplejwt.authentication.JWTAuthentication',
],
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 10
}

View File

@@ -10,11 +10,46 @@ from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
description = """
This API provides backend services for the application, allowing users to authenticate, manage their profiles, and interact with various system resources.
Authentication:
- The API uses JWT-based authentication.
- To access protected endpoints, include the header: `Authorization: Bearer <access_token>`.
- Tokens can be obtained from the authentication endpoints (login, refresh).
Request Format:
- All requests must be sent in JSON format unless otherwise specified.
- File uploads should use multipart/form-data.
Response Format:
- All responses follow a unified structure containing:
- status_code
- status (success, failure, error, not_found, created, deleted)
- message
- data (optional)
- Error responses include detailed validation messages if applicable.
Pagination:
- Pagination is supported using `limit` and `offset` query parameters.
- Default limit and maximum allowed limit may vary per endpoint.
Versioning:
- Current API version: v1.
Notes:
- Some endpoints require elevated permissions (e.g., admin access).
- All timestamps are returned in ISO 8601 format.
- For secure token storage, avoid exposing refresh tokens on client-side environments.
Use this documentation to explore available endpoints, inspect request/response formats, and test API calls interactively.
"""
schema_view = get_schema_view(
openapi.Info(
title="Qurilish Boshqaruv API",
default_version='v1',
description="Qurilish boshqaruv api",
description=description,
terms_of_service="https://www.google.com/policies/terms/",
contact=openapi.Contact(email="xoliqberdiyevbehruz12@gmail.com"),
license=openapi.License(name="Behruz's-Organization License"),