first commit
This commit is contained in:
377
frontend/belgeler/admin_hero_crud.md
Normal file
377
frontend/belgeler/admin_hero_crud.md
Normal file
@@ -0,0 +1,377 @@
|
||||
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)
|
||||
- **Senin ile sadece Frontend Üstünde Çalışıyorum**
|
||||
- **Backend ile ilgili bir şey Yapman Gerekirse Bana Söylemen Yeterli**
|
||||
|
||||
##############
|
||||
Yeni Hero Kaydi
|
||||
curl -X 'POST' \
|
||||
'http://localhost:8080/api/v1/admin/heroes' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NzE0MDU3NjYsImlhdCI6MTc3MTM5NDk2NiwiaXNfYWRtaW4iOnRydWUsInN1YiI6MiwidG9rZW5fdHlwZSI6ImFjY2VzcyJ9.pKMS0trKymCVgLZL-fTSUWB8QDAzfRVikHD_-I2iC-A' \
|
||||
-H 'Content-Type: multipart/form-data' \
|
||||
-F 'color=11111' \
|
||||
-F 'title=Title' \
|
||||
-F 'text1=Text1' \
|
||||
-F 'text2=Text2' \
|
||||
-F 'text4=Text4' \
|
||||
-F 'text5=Text5' \
|
||||
-F 'is_active=true' \
|
||||
-F 'image=@845575.png;type=image/png'
|
||||
|
||||
Request URL
|
||||
|
||||
http://localhost:8080/api/v1/admin/heroes
|
||||
|
||||
Server response
|
||||
Code Details
|
||||
201
|
||||
Response body
|
||||
|
||||
{
|
||||
"data": {
|
||||
"ID": 1,
|
||||
"CreatedAt": "2026-02-18T06:17:46.077799Z",
|
||||
"UpdatedAt": "2026-02-18T06:17:46.077799Z",
|
||||
"DeletedAt": null,
|
||||
"color": "11111",
|
||||
"title": "Title",
|
||||
"text1": "Text1",
|
||||
"text2": "Text2",
|
||||
"text4": "Text4",
|
||||
"text5": "Text5",
|
||||
"image": "/uploads/heroes/hero-1771395466075911000.png",
|
||||
"is_active": true
|
||||
}
|
||||
}
|
||||
|
||||
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: 286
|
||||
content-type: application/json; charset=utf-8
|
||||
date: Wed,18 Feb 2026 06:17:46 GMT
|
||||
vary: Origin
|
||||
|
||||
##################
|
||||
restore hero
|
||||
curl -X 'POST' \
|
||||
'http://localhost:8080/api/v1/admin/heroes/2/restore' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NzE0MDU3NjYsImlhdCI6MTc3MTM5NDk2NiwiaXNfYWRtaW4iOnRydWUsInN1YiI6MiwidG9rZW5fdHlwZSI6ImFjY2VzcyJ9.pKMS0trKymCVgLZL-fTSUWB8QDAzfRVikHD_-I2iC-A' \
|
||||
-d ''
|
||||
|
||||
Request URL
|
||||
|
||||
http://localhost:8080/api/v1/admin/heroes/2/restore
|
||||
|
||||
Server response
|
||||
Code Details
|
||||
200
|
||||
Response body
|
||||
|
||||
{
|
||||
"data": {
|
||||
"ID": 2,
|
||||
"CreatedAt": "2026-02-18T09:18:32.257+03:00",
|
||||
"UpdatedAt": "2026-02-18T06:19:40.645922Z",
|
||||
"DeletedAt": null,
|
||||
"color": "22222",
|
||||
"title": "Title",
|
||||
"text1": "Text1",
|
||||
"text2": "Text2",
|
||||
"text4": "Text4",
|
||||
"text5": "Text5",
|
||||
"image": "/uploads/heroes/hero-1771395512255077000.png",
|
||||
"is_active": true
|
||||
}
|
||||
}
|
||||
|
||||
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: 288
|
||||
content-type: application/json; charset=utf-8
|
||||
date: Wed,18 Feb 2026 06:19:40 GMT
|
||||
vary: Origin
|
||||
|
||||
##################
|
||||
hero silmek
|
||||
curl -X 'DELETE' \
|
||||
'http://localhost:8080/api/v1/admin/heroes/3' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NzE0MDU3NjYsImlhdCI6MTc3MTM5NDk2NiwiaXNfYWRtaW4iOnRydWUsInN1YiI6MiwidG9rZW5fdHlwZSI6ImFjY2VzcyJ9.pKMS0trKymCVgLZL-fTSUWB8QDAzfRVikHD_-I2iC-A'
|
||||
|
||||
Request URL
|
||||
|
||||
http://localhost:8080/api/v1/admin/heroes/3
|
||||
|
||||
Server response
|
||||
Code Details
|
||||
200
|
||||
Undocumented
|
||||
|
||||
Response body
|
||||
|
||||
{
|
||||
"id": 3,
|
||||
"message": "hero 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: 46
|
||||
content-type: application/json; charset=utf-8
|
||||
date: Wed,18 Feb 2026 06:20:49 GMT
|
||||
vary: Origin
|
||||
|
||||
##################
|
||||
sadece soft delete olmuslar
|
||||
curl -X 'GET' \
|
||||
'http://localhost:8080/api/v1/admin/heroes?soft=only' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NzE0MDU3NjYsImlhdCI6MTc3MTM5NDk2NiwiaXNfYWRtaW4iOnRydWUsInN1YiI6MiwidG9rZW5fdHlwZSI6ImFjY2VzcyJ9.pKMS0trKymCVgLZL-fTSUWB8QDAzfRVikHD_-I2iC-A'
|
||||
|
||||
Request URL
|
||||
|
||||
http://localhost:8080/api/v1/admin/heroes?soft=only
|
||||
|
||||
Server response
|
||||
Code Details
|
||||
200
|
||||
Response body
|
||||
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"ID": 3,
|
||||
"CreatedAt": "2026-02-18T09:20:43.16+03:00",
|
||||
"UpdatedAt": "2026-02-18T09:20:43.16+03:00",
|
||||
"DeletedAt": "2026-02-18T09:20:49.969+03:00",
|
||||
"color": "22222",
|
||||
"title": "Title",
|
||||
"text1": "Text1",
|
||||
"text2": "Text2",
|
||||
"text4": "Text4",
|
||||
"text5": "Text5",
|
||||
"image": "/uploads/heroes/hero-1771395643158537000.png",
|
||||
"is_active": true
|
||||
},
|
||||
{
|
||||
"ID": 2,
|
||||
"CreatedAt": "2026-02-18T09:18:32.257+03:00",
|
||||
"UpdatedAt": "2026-02-18T09:18:32.257+03:00",
|
||||
"DeletedAt": "2026-02-18T09:19:05.81+03:00",
|
||||
"color": "22222",
|
||||
"title": "Title",
|
||||
"text1": "Text1",
|
||||
"text2": "Text2",
|
||||
"text4": "Text4",
|
||||
"text5": "Text5",
|
||||
"image": "/uploads/heroes/hero-1771395512255077000.png",
|
||||
"is_active": true
|
||||
}
|
||||
],
|
||||
"page": 1,
|
||||
"per_page": 20,
|
||||
"total": 2
|
||||
}
|
||||
|
||||
Response headers
|
||||
|
||||
content-length: 659
|
||||
content-type: application/json; charset=utf-8
|
||||
date: Wed,18 Feb 2026 06:22:05 GMT
|
||||
|
||||
##################
|
||||
soft delete olmuslar ve silinmeyenler yani hepsi
|
||||
curl -X 'GET' \
|
||||
'http://localhost:8080/api/v1/admin/heroes?soft=with' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NzE0MDU3NjYsImlhdCI6MTc3MTM5NDk2NiwiaXNfYWRtaW4iOnRydWUsInN1YiI6MiwidG9rZW5fdHlwZSI6ImFjY2VzcyJ9.pKMS0trKymCVgLZL-fTSUWB8QDAzfRVikHD_-I2iC-A'
|
||||
|
||||
Request URL
|
||||
|
||||
http://localhost:8080/api/v1/admin/heroes?soft=with
|
||||
|
||||
Server response
|
||||
Code Details
|
||||
200
|
||||
Response body
|
||||
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"ID": 3,
|
||||
"CreatedAt": "2026-02-18T09:20:43.16+03:00",
|
||||
"UpdatedAt": "2026-02-18T09:20:43.16+03:00",
|
||||
"DeletedAt": "2026-02-18T09:20:49.969+03:00",
|
||||
"color": "22222",
|
||||
"title": "Title",
|
||||
"text1": "Text1",
|
||||
"text2": "Text2",
|
||||
"text4": "Text4",
|
||||
"text5": "Text5",
|
||||
"image": "/uploads/heroes/hero-1771395643158537000.png",
|
||||
"is_active": true
|
||||
},
|
||||
{
|
||||
"ID": 2,
|
||||
"CreatedAt": "2026-02-18T09:18:32.257+03:00",
|
||||
"UpdatedAt": "2026-02-18T09:18:32.257+03:00",
|
||||
"DeletedAt": "2026-02-18T09:19:05.81+03:00",
|
||||
"color": "22222",
|
||||
"title": "Title",
|
||||
"text1": "Text1",
|
||||
"text2": "Text2",
|
||||
"text4": "Text4",
|
||||
"text5": "Text5",
|
||||
"image": "/uploads/heroes/hero-1771395512255077000.png",
|
||||
"is_active": true
|
||||
},
|
||||
{
|
||||
"ID": 1,
|
||||
"CreatedAt": "2026-02-18T09:17:46.077+03:00",
|
||||
"UpdatedAt": "2026-02-18T09:17:46.077+03:00",
|
||||
"DeletedAt": null,
|
||||
"color": "11111",
|
||||
"title": "Title",
|
||||
"text1": "Text1",
|
||||
"text2": "Text2",
|
||||
"text4": "Text4",
|
||||
"text5": "Text5",
|
||||
"image": "/uploads/heroes/hero-1771395466075911000.png",
|
||||
"is_active": true
|
||||
}
|
||||
],
|
||||
"page": 1,
|
||||
"per_page": 20,
|
||||
"total": 3
|
||||
}
|
||||
|
||||
Response headers
|
||||
|
||||
content-length: 941
|
||||
content-type: application/json; charset=utf-8
|
||||
date: Wed,18 Feb 2026 06:22:49 GMT
|
||||
|
||||
##################
|
||||
tek getiröe
|
||||
curl -X 'GET' \
|
||||
'http://localhost:8080/api/v1/admin/heroes/2' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NzE0MDU3NjYsImlhdCI6MTc3MTM5NDk2NiwiaXNfYWRtaW4iOnRydWUsInN1YiI6MiwidG9rZW5fdHlwZSI6ImFjY2VzcyJ9.pKMS0trKymCVgLZL-fTSUWB8QDAzfRVikHD_-I2iC-A'
|
||||
|
||||
Request URL
|
||||
|
||||
http://localhost:8080/api/v1/admin/heroes/2
|
||||
|
||||
Server response
|
||||
Code Details
|
||||
200
|
||||
Response body
|
||||
|
||||
{
|
||||
"data": {
|
||||
"ID": 2,
|
||||
"CreatedAt": "2026-02-18T09:18:32.257+03:00",
|
||||
"UpdatedAt": "2026-02-18T09:18:32.257+03:00",
|
||||
"DeletedAt": "2026-02-18T09:19:05.81+03:00",
|
||||
"color": "22222",
|
||||
"title": "Title",
|
||||
"text1": "Text1",
|
||||
"text2": "Text2",
|
||||
"text4": "Text4",
|
||||
"text5": "Text5",
|
||||
"image": "/uploads/heroes/hero-1771395512255077000.png",
|
||||
"is_active": true
|
||||
}
|
||||
}
|
||||
|
||||
Response headers
|
||||
|
||||
content-length: 316
|
||||
content-type: application/json; charset=utf-8
|
||||
date: Wed,18 Feb 2026 06:24:07 GMT
|
||||
|
||||
##################
|
||||
hero guncelleme
|
||||
curl -X 'PUT' \
|
||||
'http://localhost:8080/api/v1/admin/heroes/1' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NzE0MDU3NjYsImlhdCI6MTc3MTM5NDk2NiwiaXNfYWRtaW4iOnRydWUsInN1YiI6MiwidG9rZW5fdHlwZSI6ImFjY2VzcyJ9.pKMS0trKymCVgLZL-fTSUWB8QDAzfRVikHD_-I2iC-A' \
|
||||
-H 'Content-Type: multipart/form-data' \
|
||||
-F 'color=ee' \
|
||||
-F 'title=ee' \
|
||||
-F 'text1=ee' \
|
||||
-F 'text2=ee' \
|
||||
-F 'text4=ee' \
|
||||
-F 'text5=ee' \
|
||||
-F 'is_active=true' \
|
||||
-F 'image=@accounts.jpg;type=image/jpeg'
|
||||
|
||||
Request URL
|
||||
|
||||
http://localhost:8080/api/v1/admin/heroes/1
|
||||
|
||||
Server response
|
||||
Code Details
|
||||
200
|
||||
Response body
|
||||
|
||||
{
|
||||
"data": {
|
||||
"ID": 1,
|
||||
"CreatedAt": "2026-02-18T09:17:46.077+03:00",
|
||||
"UpdatedAt": "2026-02-18T06:25:06.633353Z",
|
||||
"DeletedAt": null,
|
||||
"color": "ee",
|
||||
"title": "ee",
|
||||
"text1": "ee",
|
||||
"text2": "ee",
|
||||
"text4": "ee",
|
||||
"text5": "ee",
|
||||
"image": "/uploads/heroes/hero-1771395906631296000.jpg",
|
||||
"is_active": true
|
||||
}
|
||||
}
|
||||
|
||||
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: 270
|
||||
content-type: application/json; charset=utf-8
|
||||
date: Wed,18 Feb 2026 06:25:06 GMT
|
||||
vary: Origin
|
||||
|
||||
##################
|
||||
Eklenen alanlari
|
||||
"width": 0,
|
||||
"height": 0,
|
||||
"quality": 0,
|
||||
"format": ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user