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:
36
system1-factory/api/models/uploadModel.js
Normal file
36
system1-factory/api/models/uploadModel.js
Normal file
@@ -0,0 +1,36 @@
|
||||
const { getDb } = require('../dbPool');
|
||||
|
||||
// 1. 문서 업로드
|
||||
const create = async (doc) => {
|
||||
const db = await getDb();
|
||||
const sql = `
|
||||
INSERT INTO uploaded_documents
|
||||
(title, tags, description, original_name, stored_name, file_path, file_type, file_size, submitted_by)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
`;
|
||||
const values = [
|
||||
doc.title,
|
||||
doc.tags,
|
||||
doc.description,
|
||||
doc.original_name,
|
||||
doc.stored_name,
|
||||
doc.file_path,
|
||||
doc.file_type,
|
||||
doc.file_size,
|
||||
doc.submitted_by
|
||||
];
|
||||
const [result] = await db.query(sql, values);
|
||||
return result.insertId;
|
||||
};
|
||||
|
||||
// 2. 전체 문서 목록 조회
|
||||
const getAll = async () => {
|
||||
const db = await getDb();
|
||||
const [rows] = await db.query(`SELECT * FROM uploaded_documents ORDER BY created_at DESC`);
|
||||
return rows;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
create,
|
||||
getAll
|
||||
};
|
||||
Reference in New Issue
Block a user