11import express from 'express' ;
2- import { changeUserInfoController , getMyInstController , mailVerifyController , sendMailCodeController , userLogOutController , userSignOutController , userSignupController , userWhoCameBackController } from './user.controller/user.controller' ;
2+ import { changeUserInfoController , getMyInstController , mailVerifyController , mailVerifyStudentIdController , sendMailCodeController , userLogOutController , userSignOutController , userSignupController , userWhoCameBackController } from './user.controller/user.controller' ;
33import { authenticateToken } from '../security/JWT/auth.jwt' ;
44
55const router = express . Router ( ) ;
@@ -10,6 +10,7 @@ router.get('/', (req, res) => {
1010
1111router . post ( '/mailCode' , sendMailCodeController ) ; // 처음 로그인 시 사용 또는 다시 로그인 시도 시 사용
1212router . post ( '/verify' , mailVerifyController ) ; // 인증 코드 검증 및 토큰 발급
13+ router . post ( '/verifyStudentId' , mailVerifyStudentIdController ) ; // 인증 코드 검증 및 토큰 발급
1314router . patch ( '/signup' , authenticateToken , userSignupController ) ; // 이미 가입한 회원 초기 정보 입력
1415
1516router . patch ( '/logOut' , authenticateToken , userLogOutController ) ; // 로그아웃 처리
@@ -521,4 +522,88 @@ router.get('/getMyIns', authenticateToken, getMyInstController);
521522 * message:
522523 * type: string
523524 */
525+
526+
527+ /**
528+ * @swagger
529+ * /user/verifyStudentId:
530+ * post:
531+ * summary: 학생 메일 인증 코드 검증 및 토큰 발급
532+ * description: 클라이언트에서 받은 인증 코드와 학번을 검증하여 성공 시 토큰을 발급합니다.
533+ * tags:
534+ * - user
535+ * requestBody:
536+ * required: true
537+ * content:
538+ * application/json:
539+ * schema:
540+ * type: object
541+ * required:
542+ * - mailVerification
543+ * - student_id
544+ * properties:
545+ * mailVerification:
546+ * type: string
547+ * example: "123456"
548+ * description: 인증 메일로 받은 6자리 코드
549+ * student_id:
550+ * type: string
551+ * example: "202312345"
552+ * description: 사용자의 학번
553+ * responses:
554+ * 200:
555+ * description: 인증 성공 및 토큰 발급
556+ * content:
557+ * application/json:
558+ * schema:
559+ * type: object
560+ * properties:
561+ * message:
562+ * type: string
563+ * example: "메일 인증 완료"
564+ * token:
565+ * type: string
566+ * example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
567+ * 401:
568+ * description: 인증 코드 또는 학번 누락
569+ * content:
570+ * application/json:
571+ * schema:
572+ * type: object
573+ * properties:
574+ * message:
575+ * type: string
576+ * example: "인증 코드가 제공되지 않았습니다."
577+ * 403:
578+ * description: 잘못된 인증 코드
579+ * content:
580+ * application/json:
581+ * schema:
582+ * type: object
583+ * properties:
584+ * message:
585+ * type: string
586+ * example: "인증 코드가 올바르지 않습니다. 다시 인증해주세요."
587+ * 408:
588+ * description: 인증 코드가 6자리가 아님
589+ * content:
590+ * application/json:
591+ * schema:
592+ * type: object
593+ * properties:
594+ * message:
595+ * type: string
596+ * example: "인증 코드는 6자리입니다."
597+ * 500:
598+ * description: 서버 내부 오류
599+ * content:
600+ * application/json:
601+ * schema:
602+ * type: object
603+ * properties:
604+ * message:
605+ * type: string
606+ * example: "서버 오류가 발생했습니다."
607+ */
608+
524609export default router ;
0 commit comments