// routes/workplaceRoutes.js const express = require('express'); const router = express.Router(); const workplaceController = require('../controllers/workplaceController'); // ==================== 카테고리(공장) 관리 ==================== // CREATE 카테고리 router.post('/categories', workplaceController.createCategory); // READ ALL 카테고리 router.get('/categories', workplaceController.getAllCategories); // READ ACTIVE 카테고리 router.get('/categories/active/list', workplaceController.getActiveCategories); // READ ONE 카테고리 router.get('/categories/:id', workplaceController.getCategoryById); // UPDATE 카테고리 router.put('/categories/:id', workplaceController.updateCategory); // DELETE 카테고리 router.delete('/categories/:id', workplaceController.deleteCategory); // ==================== 작업장 관리 ==================== // CREATE 작업장 router.post('/', workplaceController.createWorkplace); // READ ALL 작업장 (쿼리 파라미터로 카테고리 필터링 가능: ?category_id=1) router.get('/', workplaceController.getAllWorkplaces); // READ ACTIVE 작업장 router.get('/active/list', workplaceController.getActiveWorkplaces); // READ ONE 작업장 router.get('/:id', workplaceController.getWorkplaceById); // UPDATE 작업장 router.put('/:id', workplaceController.updateWorkplace); // DELETE 작업장 router.delete('/:id', workplaceController.deleteWorkplace); module.exports = router;