ERP-node/backend-node/src/routes/driverRoutes.ts

37 lines
872 B
TypeScript

// 공차중계 운전자 API 라우터
import { Router } from "express";
import { DriverController } from "../controllers/driverController";
import { authenticateToken } from "../middleware/authMiddleware";
const router = Router();
// 모든 라우트에 인증 필요
router.use(authenticateToken);
/**
* GET /api/driver/profile
* 운전자 프로필 조회
*/
router.get("/profile", DriverController.getProfile);
/**
* PUT /api/driver/profile
* 운전자 프로필 수정 (이름, 연락처, 면허정보, 차량번호, 차종)
*/
router.put("/profile", DriverController.updateProfile);
/**
* PUT /api/driver/status
* 차량 상태 변경 (대기/정비만)
*/
router.put("/status", DriverController.updateStatus);
/**
* DELETE /api/driver/account
* 회원 탈퇴
*/
router.delete("/account", DriverController.deleteAccount);
export default router;