İlk sürüm: hDiyanetProxy v1.0.0
- Backend: Node.js + Express + MySQL + JWT auth - 8 MySQL tablosu (users, countries, states, cities, prayer_times, ramadan_times, eid_times, fetch_logs) - Diyanet API entegrasyonu (auth + token yönetimi) - Tüm API endpointleri (places, prayer-times, ramadan, eid, admin) - Rate limiting, CORS, input validation - Cron job (gece 02:00 otomatik veri çekme) - Frontend: Login, Dashboard, Fetch Panel, Namaz Vakitleri, Ramazan, Admin, Profil - Admin kullanıcı: admin/admin123
This commit is contained in:
21
backend/src/controllers/eidController.js
Normal file
21
backend/src/controllers/eidController.js
Normal file
@@ -0,0 +1,21 @@
|
||||
// hDiyanetProxy - Eid Controller
|
||||
const EidModel = require('../models/EidTime');
|
||||
|
||||
const EidController = {
|
||||
// Şehre göre bayram vakitlerini getir
|
||||
async getByCityId(req, res) {
|
||||
try {
|
||||
const { cityId } = req.query;
|
||||
if (!cityId) {
|
||||
return res.status(400).json({ error: 'cityId parametresi gerekli' });
|
||||
}
|
||||
const times = await EidModel.getByCityId(parseInt(cityId));
|
||||
res.json(times);
|
||||
} catch (err) {
|
||||
console.error('Eid hatası:', err);
|
||||
res.status(500).json({ error: 'Sunucu hatası' });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = EidController;
|
||||
Reference in New Issue
Block a user