fix: 보안 취약점 해결 및 인증 시스템 오류 수정

- npm audit fix로 tar-fs, brace-expansion 취약점 해결
- analysisRoutes.js에서 authMiddleware import 오류 수정
- dailyWorkReportController.js에 누락된 getAccumulatedReports 함수 추가
- JWT 인증 시스템 정상 작동 확인 완료
This commit is contained in:
Hyungi Ahn
2025-07-31 10:42:53 +09:00
parent a1b7d3c5df
commit ef06cec8d6
3 changed files with 43 additions and 8 deletions

View File

@@ -491,6 +491,41 @@ const getErrorTypes = (req, res) => {
});
};
/**
* 📊 누적 현황 조회
*/
const getAccumulatedReports = (req, res) => {
const { date, worker_id } = req.query;
if (!date || !worker_id) {
return res.status(400).json({
error: 'date와 worker_id가 필요합니다.',
example: 'date=2024-06-16&worker_id=1'
});
}
console.log(`📊 누적 현황 조회: date=${date}, worker_id=${worker_id}`);
dailyWorkReportModel.getAccumulatedReportsByDate(date, worker_id, (err, data) => {
if (err) {
console.error('누적 현황 조회 오류:', err);
return res.status(500).json({
error: '누적 현황 조회 중 오류가 발생했습니다.',
details: err.message
});
}
console.log(`📊 누적 현황 조회 결과: ${data.length}`);
res.json({
date,
worker_id,
total_entries: data.length,
accumulated_data: data,
timestamp: new Date().toISOString()
});
});
};
// 모든 컨트롤러 함수 내보내기 (리팩토링된 함수 위주로 재구성)
module.exports = {
// 📝 V2 핵심 CRUD 함수