All files / controllers uploadController.js

0% Statements 0/9
100% Branches 0/0
0% Functions 0/2
0% Lines 0/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39                                                                             
/**
 * 문서 업로드 관리 컨트롤러
 *
 * 파일 업로드 및 문서 메타데이터 CRUD API 엔드포인트 핸들러
 *
 * @author TK-FB-Project
 * @since 2025-12-11
 */
 
const uploadService = require('../services/uploadService');
const { asyncHandler } = require('../middlewares/errorHandler');
 
/**
 * 문서 업로드
 */
exports.createUpload = asyncHandler(async (req, res) => {
  const doc = req.body;
  const result = await uploadService.createUploadService(doc);
 
  res.status(201).json({
    success: true,
    data: result,
    message: '문서가 성공적으로 업로드되었습니다'
  });
});
 
/**
 * 전체 업로드 문서 조회
 */
exports.getUploads = asyncHandler(async (req, res) => {
  const rows = await uploadService.getAllUploadsService();
 
  res.json({
    success: true,
    data: rows,
    message: '업로드 문서 목록 조회 성공'
  });
});