1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/******************************************************************************************
📍 منصة تحليل الأمان الجغرافي MKT KSA – تطوير منصور بن خالد
* 📄 رخصة Apache 2.0 – يسمح بالاستخدام والتعديل بشرط النسبة وعدم تقديم ضمانات.
* MKT KSA Geolocation Security – Developed by Mansour Bin Khalid (KSA 🇸🇦)
* Licensed under Apache 2.0 – https://www.apache.org/licenses/LICENSE-2.0
* © 2025 All rights reserved.
اسم الملف: auth.rs
المسار: src/api/auth.rs
وظيفة الملف:
هذا الملف مسؤول عن جميع نقاط النهاية (Endpoints) المتعلقة بالمصادقة وإدارة المستخدمين عبر واجهة برمجة التطبيقات (API).
يوفر نقطة نهاية لجلب بيانات مستخدم معين بناءً على معرفه (UUID)، مع تطبيق فحص الصلاحيات.
يعتمد على خدمة UserService من منطق المشروع (core/behavior_bio) لجلب بيانات المستخدم من قاعدة البيانات.
حالياً، لا توجد عمليات تسجيل دخول أو تسجيل مستخدم جديدة في هذا الملف، بل يركز فقط على استرجاع بيانات المستخدم.
الملف مصمم ليكون جزءًا من طبقة API التي تتعامل مع المستخدمين، ويمكن توسيعه مستقبلاً ليشمل عمليات تسجيل الدخول والتسجيل وتحديث بيانات المستخدم.
File name: auth.rs
Path: src/api/auth.rs
File purpose:
This file is responsible for all API endpoints related to authentication and user management.
It provides an endpoint to fetch a specific user's data by their UUID, with permission checks.
It relies on the UserService from the core logic (core/behavior_bio) to retrieve user data from the database.
Currently, there are no login or registration operations in this file; it focuses only on fetching user data.
The file is designed as part of the API layer that handles user-related operations, and can be extended in the future to include login, registration, and user data updates.
******************************************************************************************/
use ;
// use sqlx::PgPool; // تم التعليق بعد التحويل إلى sea-orm
use Uuid;
use crateUserService;
/// نقطة نهاية لجلب بيانات مستخدم معين بناءً على معرفه.
/// Endpoint to fetch a specific user's data by their ID.
/// تطبق فحص الصلاحيات قبل إعادة البيانات.
/// Applies permission checks before returning data.
pub async