import { Router } from 'express';
import { mailAccountFileController } from '../controllers/mailAccountFileController';
import { authenticateToken } from '../middleware/authMiddleware';

const router = Router();

// 모든 메일 계정 라우트에 인증 미들웨어 적용
router.use(authenticateToken);

router.get('/', (req, res) => mailAccountFileController.getAllAccounts(req, res));
router.get('/:id', (req, res) => mailAccountFileController.getAccountById(req, res));
router.post('/', (req, res) => mailAccountFileController.createAccount(req, res));
router.put('/:id', (req, res) => mailAccountFileController.updateAccount(req, res));
router.delete('/:id', (req, res) => mailAccountFileController.deleteAccount(req, res));
router.post('/:id/test-connection', (req, res) => mailAccountFileController.testConnection(req, res));

export default router;

