타입에러 수정
This commit is contained in:
parent
669717f656
commit
e9738ce67f
|
|
@ -1,14 +1,15 @@
|
||||||
// 공차중계 운전자 컨트롤러
|
// 공차중계 운전자 컨트롤러
|
||||||
import { Request, Response } from "express";
|
import { Response } from "express";
|
||||||
import { query } from "../database/db";
|
import { query } from "../database/db";
|
||||||
import { logger } from "../utils/logger";
|
import { logger } from "../utils/logger";
|
||||||
|
import { AuthenticatedRequest } from "../types/auth";
|
||||||
|
|
||||||
export class DriverController {
|
export class DriverController {
|
||||||
/**
|
/**
|
||||||
* GET /api/driver/profile
|
* GET /api/driver/profile
|
||||||
* 운전자 프로필 조회
|
* 운전자 프로필 조회
|
||||||
*/
|
*/
|
||||||
static async getProfile(req: Request, res: Response): Promise<void> {
|
static async getProfile(req: AuthenticatedRequest, res: Response): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const userId = req.user?.userId;
|
const userId = req.user?.userId;
|
||||||
|
|
||||||
|
|
@ -85,7 +86,7 @@ export class DriverController {
|
||||||
* PUT /api/driver/profile
|
* PUT /api/driver/profile
|
||||||
* 운전자 프로필 수정 (이름, 연락처, 면허정보, 차량번호, 차종)
|
* 운전자 프로필 수정 (이름, 연락처, 면허정보, 차량번호, 차종)
|
||||||
*/
|
*/
|
||||||
static async updateProfile(req: Request, res: Response): Promise<void> {
|
static async updateProfile(req: AuthenticatedRequest, res: Response): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const userId = req.user?.userId;
|
const userId = req.user?.userId;
|
||||||
|
|
||||||
|
|
@ -183,7 +184,7 @@ export class DriverController {
|
||||||
* PUT /api/driver/status
|
* PUT /api/driver/status
|
||||||
* 차량 상태 변경 (대기/정비만 가능)
|
* 차량 상태 변경 (대기/정비만 가능)
|
||||||
*/
|
*/
|
||||||
static async updateStatus(req: Request, res: Response): Promise<void> {
|
static async updateStatus(req: AuthenticatedRequest, res: Response): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const userId = req.user?.userId;
|
const userId = req.user?.userId;
|
||||||
|
|
||||||
|
|
@ -246,7 +247,7 @@ export class DriverController {
|
||||||
* DELETE /api/driver/vehicle
|
* DELETE /api/driver/vehicle
|
||||||
* 차량 삭제 (user_id = NULL 처리, 기록 보존)
|
* 차량 삭제 (user_id = NULL 처리, 기록 보존)
|
||||||
*/
|
*/
|
||||||
static async deleteVehicle(req: Request, res: Response): Promise<void> {
|
static async deleteVehicle(req: AuthenticatedRequest, res: Response): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const userId = req.user?.userId;
|
const userId = req.user?.userId;
|
||||||
|
|
||||||
|
|
@ -303,7 +304,7 @@ export class DriverController {
|
||||||
* POST /api/driver/vehicle
|
* POST /api/driver/vehicle
|
||||||
* 새 차량 등록
|
* 새 차량 등록
|
||||||
*/
|
*/
|
||||||
static async registerVehicle(req: Request, res: Response): Promise<void> {
|
static async registerVehicle(req: AuthenticatedRequest, res: Response): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const userId = req.user?.userId;
|
const userId = req.user?.userId;
|
||||||
const companyCode = req.user?.companyCode;
|
const companyCode = req.user?.companyCode;
|
||||||
|
|
@ -400,7 +401,7 @@ export class DriverController {
|
||||||
* DELETE /api/driver/account
|
* DELETE /api/driver/account
|
||||||
* 회원 탈퇴 (차량 정보 포함 삭제)
|
* 회원 탈퇴 (차량 정보 포함 삭제)
|
||||||
*/
|
*/
|
||||||
static async deleteAccount(req: Request, res: Response): Promise<void> {
|
static async deleteAccount(req: AuthenticatedRequest, res: Response): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const userId = req.user?.userId;
|
const userId = req.user?.userId;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue