feat: 3-System 분리 프로젝트 초기 코드 작성
TK-FB(공장관리+신고)와 M-Project(부적합관리)를 3개 독립 시스템으로 분리하기 위한 전체 코드 구조 작성. - SSO 인증 서비스 (bcrypt + pbkdf2 이중 해시 지원) - System 1: 공장관리 (TK-FB 기반, 신고 코드 제거) - System 2: 신고 (TK-FB에서 workIssue 코드 추출) - System 3: 부적합관리 (M-Project 기반) - Gateway 포털 (path-based 라우팅) - 통합 docker-compose.yml 및 배포 스크립트 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* 일일 이슈 보고서 관리 컨트롤러
|
||||
*
|
||||
* 일일 이슈 보고서 CRUD API 엔드포인트 핸들러
|
||||
*
|
||||
* @author TK-FB-Project
|
||||
* @since 2025-12-11
|
||||
*/
|
||||
|
||||
const dailyIssueReportService = require('../services/dailyIssueReportService');
|
||||
const { asyncHandler } = require('../middlewares/errorHandler');
|
||||
|
||||
/**
|
||||
* 일일 이슈 보고서 생성
|
||||
*/
|
||||
const createDailyIssueReport = asyncHandler(async (req, res) => {
|
||||
// 프론트엔드에서 worker_ids 또는 worker_id로 보낼 수 있음
|
||||
const issueData = {
|
||||
...req.body,
|
||||
worker_ids: req.body.worker_ids || req.body.worker_id
|
||||
};
|
||||
|
||||
const result = await dailyIssueReportService.createDailyIssueReportService(issueData);
|
||||
|
||||
res.status(201).json({
|
||||
success: true,
|
||||
data: result,
|
||||
message: result.message
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* 날짜별 이슈 조회
|
||||
*/
|
||||
const getDailyIssuesByDate = asyncHandler(async (req, res) => {
|
||||
const { date } = req.query;
|
||||
const issues = await dailyIssueReportService.getDailyIssuesByDateService(date);
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
data: issues,
|
||||
message: '이슈 보고서 조회 성공'
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* 이슈 보고서 삭제
|
||||
*/
|
||||
const removeDailyIssue = asyncHandler(async (req, res) => {
|
||||
const { id } = req.params;
|
||||
const result = await dailyIssueReportService.removeDailyIssueService(id);
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
data: result,
|
||||
message: result.message
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
createDailyIssueReport,
|
||||
getDailyIssuesByDate,
|
||||
removeDailyIssue
|
||||
};
|
||||
Reference in New Issue
Block a user