- 공장(카테고리) 및 작업장 CRUD API 구현 - 탭 기반 UI로 공장별 작업장 필터링 - 터치 최적화된 관리자 페이지 - DB 테이블: workplace_categories, workplaces - 관리자 메뉴에 작업장 관리 추가 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
47 lines
1.4 KiB
JavaScript
47 lines
1.4 KiB
JavaScript
// 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;
|