first commit
This commit is contained in:
306
frontend/belgeler/admin_user_crud.md
Normal file
306
frontend/belgeler/admin_user_crud.md
Normal file
@@ -0,0 +1,306 @@
|
||||
frontend
|
||||
Proje `frontend` klasörü altında yapılandırılmıştır. Gerekli tüm paketler (`package.json`) önceden yüklenmiştir:
|
||||
- **Framework:** Next.js 16 (App Router)
|
||||
- **UI:** React 19, Tailwind CSS v4, shadcn/ui
|
||||
- **İkonlar:** lucide-react
|
||||
- **Validasyon:** Zod
|
||||
- **Auth:** NextAuth.js
|
||||
- **Bildirimler:** SweetAlert2
|
||||
- **Güvenlik:** nextjs-turnstile (Cloudflare)
|
||||
|
||||
Hem softdelete edilmisler hermse aktif olan userleri Userler
|
||||
|
||||
curl -X 'GET' \
|
||||
'http://localhost:8080/api/v1/admin/users?soft=with' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NzEzOTQ1NjksImlhdCI6MTc3MTM4Mzc2OSwiaXNfYWRtaW4iOnRydWUsInN1YiI6MiwidG9rZW5fdHlwZSI6ImFjY2VzcyJ9.HCXkj1sYeR-1sXCvIQDgzgLuRVWo2NwI5M0WFTsbEtU'
|
||||
|
||||
Request URL
|
||||
|
||||
http://localhost:8080/api/v1/admin/users?soft=with
|
||||
|
||||
Server response
|
||||
Code Details
|
||||
200
|
||||
Response body
|
||||
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"id": 12,
|
||||
"username": "aaaa bbb cccc ddddd",
|
||||
"email": "arxxxxes2000@gmail.com",
|
||||
"email_verified": true,
|
||||
"is_admin": false
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"username": "update",
|
||||
"email": "update@update.cem",
|
||||
"email_verified": true,
|
||||
"is_admin": false
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"username": "asasa fgfg",
|
||||
"email": "aaaareaaas2ddd000@gmail.com",
|
||||
"email_verified": true,
|
||||
"is_admin": false,
|
||||
"deleted_at": "2026-02-18T06:20:56.99+03:00"
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"username": "dfgdfg dfgdfg",
|
||||
"email": "ares2ggddd000@gmail.com",
|
||||
"email_verified": false,
|
||||
"is_admin": false
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"username": "vbcvbcvbb",
|
||||
"email": "ares2000cvbcvb@gmail.com",
|
||||
"email_verified": true,
|
||||
"is_admin": false
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"username": "qweqweqwe",
|
||||
"email": "areseeeeee2000@gmail.com",
|
||||
"email_verified": false,
|
||||
"is_admin": false
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"username": "adminsss@demo.com",
|
||||
"email": "ares2sss000@gmail.com",
|
||||
"email_verified": true,
|
||||
"is_admin": false
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"username": "aresds",
|
||||
"email": "ares@asdf.com",
|
||||
"email_verified": true,
|
||||
"is_admin": false
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"username": "sss",
|
||||
"email": "sss@ss.com",
|
||||
"email_verified": false,
|
||||
"is_admin": false
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"username": "ddd",
|
||||
"email": "ddd@dd.com",
|
||||
"email_verified": false,
|
||||
"is_admin": false
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"username": "beyhan",
|
||||
"email": "beyhan@beyhan.dev",
|
||||
"email_verified": true,
|
||||
"is_admin": true
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"username": "admin",
|
||||
"email": "admin@gauth.local",
|
||||
"email_verified": true,
|
||||
"is_admin": false
|
||||
}
|
||||
],
|
||||
"page": 1,
|
||||
"per_page": 20,
|
||||
"total": 12
|
||||
}
|
||||
|
||||
Response headers
|
||||
|
||||
content-length: 1302
|
||||
content-type: application/json; charset=utf-8
|
||||
date: Wed,18 Feb 2026 03:30:26 GMT
|
||||
|
||||
#################
|
||||
sadece soft delete edilmis Userler
|
||||
curl -X 'GET' \
|
||||
'http://localhost:8080/api/v1/admin/users?soft=only' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NzEzOTE5NDgsImlhdCI6MTc3MTM4MTE0OCwiaXNfYWRtaW4iOnRydWUsInN1YiI6MiwidG9rZW5fdHlwZSI6ImFjY2VzcyJ9.MmYgMyLECZD1TcDOvDZCyWRKk9ogjFYhXnTXYUGzhMo'
|
||||
|
||||
Request URL
|
||||
|
||||
http://localhost:8080/api/v1/admin/users?soft=only
|
||||
|
||||
Server response
|
||||
Code Details
|
||||
200
|
||||
Response body
|
||||
|
||||
{
|
||||
"items": null,
|
||||
"page": 1,
|
||||
"per_page": 20,
|
||||
"total": 0
|
||||
}
|
||||
|
||||
Response headers
|
||||
|
||||
content-length: 47
|
||||
content-type: application/json; charset=utf-8
|
||||
date: Wed,18 Feb 2026 02:22:00 GMT
|
||||
|
||||
############
|
||||
tek useri goster
|
||||
|
||||
curl -X 'GET' \
|
||||
'http://localhost:8080/api/v1/admin/users/11' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NzEzOTE5NDgsImlhdCI6MTc3MTM4MTE0OCwiaXNfYWRtaW4iOnRydWUsInN1YiI6MiwidG9rZW5fdHlwZSI6ImFjY2VzcyJ9.MmYgMyLECZD1TcDOvDZCyWRKk9ogjFYhXnTXYUGzhMo'
|
||||
|
||||
Request URL
|
||||
|
||||
http://localhost:8080/api/v1/admin/users/11
|
||||
|
||||
Server response
|
||||
Code Details
|
||||
200
|
||||
Response body
|
||||
|
||||
{
|
||||
"data": {
|
||||
"id": 11,
|
||||
"username": "zxzx jkhjk",
|
||||
"email": "addredds2dd000@gmail.com",
|
||||
"email_verified": true,
|
||||
"is_admin": false
|
||||
}
|
||||
}
|
||||
|
||||
Response headers
|
||||
|
||||
content-length: 128
|
||||
content-type: application/json; charset=utf-8
|
||||
date: Wed,18 Feb 2026 02:23:44 GMT
|
||||
|
||||
#################
|
||||
user iguncelle
|
||||
curl -X 'PUT' \
|
||||
'http://localhost:8080/api/v1/admin/users/11' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NzEzOTE5NDgsImlhdCI6MTc3MTM4MTE0OCwiaXNfYWRtaW4iOnRydWUsInN1YiI6MiwidG9rZW5fdHlwZSI6ImFjY2VzcyJ9.MmYgMyLECZD1TcDOvDZCyWRKk9ogjFYhXnTXYUGzhMo' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"email": "update@update.cem",
|
||||
"is_admin": false,
|
||||
"username": "update"
|
||||
}'
|
||||
|
||||
Request URL
|
||||
|
||||
http://localhost:8080/api/v1/admin/users/11
|
||||
|
||||
Server response
|
||||
Code Details
|
||||
200
|
||||
Response body
|
||||
|
||||
{
|
||||
"data": {
|
||||
"id": 11,
|
||||
"username": "update",
|
||||
"email": "update@update.cem",
|
||||
"email_verified": true,
|
||||
"is_admin": false
|
||||
}
|
||||
}
|
||||
|
||||
Response headers
|
||||
|
||||
access-control-allow-credentials: true
|
||||
access-control-allow-headers: Authorization,Content-Type,Accept,Origin,X-Requested-With
|
||||
access-control-allow-methods: GET,POST,PUT,PATCH,DELETE,OPTIONS
|
||||
access-control-allow-origin: http://localhost:8080
|
||||
access-control-max-age: 600
|
||||
content-length: 105
|
||||
content-type: application/json; charset=utf-8
|
||||
date: Wed,18 Feb 2026 02:25:24 GMT
|
||||
vary: Origin
|
||||
|
||||
Responses
|
||||
|
||||
#################
|
||||
useri sil
|
||||
curl -X 'DELETE' \
|
||||
'http://localhost:8080/api/v1/admin/users/10' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NzEzOTE5NDgsImlhdCI6MTc3MTM4MTE0OCwiaXNfYWRtaW4iOnRydWUsInN1YiI6MiwidG9rZW5fdHlwZSI6ImFjY2VzcyJ9.MmYgMyLECZD1TcDOvDZCyWRKk9ogjFYhXnTXYUGzhMo'
|
||||
|
||||
Request URL
|
||||
|
||||
http://localhost:8080/api/v1/admin/users/10
|
||||
|
||||
Server response
|
||||
Code Details
|
||||
200
|
||||
Undocumented
|
||||
|
||||
Response body
|
||||
|
||||
{
|
||||
"id": 10,
|
||||
"message": "user deleted successfully"
|
||||
}
|
||||
|
||||
Response headers
|
||||
|
||||
access-control-allow-credentials: true
|
||||
access-control-allow-headers: Authorization,Content-Type,Accept,Origin,X-Requested-With
|
||||
access-control-allow-methods: GET,POST,PUT,PATCH,DELETE,OPTIONS
|
||||
access-control-allow-origin: http://localhost:8080
|
||||
access-control-max-age: 600
|
||||
content-length: 47
|
||||
content-type: application/json; charset=utf-8
|
||||
date: Wed,18 Feb 2026 02:27:59 GMT
|
||||
vary: Origin
|
||||
|
||||
#################
|
||||
User Restore
|
||||
curl -X 'POST' \
|
||||
'http://localhost:8080/api/v1/admin/users/10/restore' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NzEzOTE5NDgsImlhdCI6MTc3MTM4MTE0OCwiaXNfYWRtaW4iOnRydWUsInN1YiI6MiwidG9rZW5fdHlwZSI6ImFjY2VzcyJ9.MmYgMyLECZD1TcDOvDZCyWRKk9ogjFYhXnTXYUGzhMo' \
|
||||
-d ''
|
||||
|
||||
Request URL
|
||||
|
||||
http://localhost:8080/api/v1/admin/users/10/restore
|
||||
|
||||
Server response
|
||||
Code Details
|
||||
200
|
||||
Response body
|
||||
|
||||
{
|
||||
"data": {
|
||||
"id": 10,
|
||||
"username": "sfsdf. rtyrty",
|
||||
"email": "aaaareaaas2ddd000@gmail.com",
|
||||
"email_verified": true,
|
||||
"is_admin": false
|
||||
}
|
||||
}
|
||||
|
||||
Response headers
|
||||
|
||||
access-control-allow-credentials: true
|
||||
access-control-allow-headers: Authorization,Content-Type,Accept,Origin,X-Requested-With
|
||||
access-control-allow-methods: GET,POST,PUT,PATCH,DELETE,OPTIONS
|
||||
access-control-allow-origin: http://localhost:8080
|
||||
access-control-max-age: 600
|
||||
content-length: 122
|
||||
content-type: application/json; charset=utf-8
|
||||
date: Wed,18 Feb 2026 02:28:49 GMT
|
||||
vary: Origin
|
||||
Reference in New Issue
Block a user