- 순찰/점검 기능 개선 (zone-detail 페이지 추가) - 출근/근태 시스템 개선 (연차 조회, 근무현황) - 작업분석 대분류 그룹화 및 마이그레이션 스크립트 - 모바일 네비게이션 UI 추가 - NAS 배포 도구 및 문서 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
37 lines
846 B
JavaScript
37 lines
846 B
JavaScript
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
|
|
};
|