@@ -10,7 +10,9 @@ import {
1010 Request ,
1111 Response ,
1212 Security ,
13+ Query ,
1314 Path ,
15+ Get
1416} from 'tsoa' ;
1517import { Request as ExpressRequest } from 'express' ;
1618import { TsoaSuccessResponse , TsoaFailResponse } from '../config/response_interface' ;
@@ -38,6 +40,79 @@ export interface CreateScheduleSuccess {
3840@Route ( 'user/alba/schedule' )
3941@Tags ( 'User Alba Schedule' )
4042export class UserAlbaScheduleController extends Controller {
43+
44+ /**
45+ * 내 유저 알바 스케줄 목록 조회 (커서/사이즈 없음)
46+ * 예) /user/alba/schedule?month=2026-02
47+ */
48+ @Security ( 'jwt' )
49+ @Get ( '' )
50+ @SuccessResponse ( 200 , '유저 알바 스케줄 목록 조회 성공' )
51+ @Response < TsoaFailResponse < any > > ( 401 , 'Unauthorized' , {
52+ resultType : 'FAIL' as any ,
53+ error : { errorCode : 'EC401' , errorMessage : '인증이 필요합니다.' , data : null } ,
54+ success : null ,
55+ } )
56+ @Response < TsoaFailResponse < any > > ( 400 , 'Bad Request' , {
57+ resultType : 'FAIL' as any ,
58+ error : { errorCode : 'EC400' , errorMessage : '조회 요청이 부적절합니다.' , data : null } ,
59+ success : null ,
60+ } )
61+ @Response < TsoaFailResponse < any > > ( 500 , 'Internal Server Error' , {
62+ resultType : 'FAIL' as any ,
63+ error : { errorCode : 'EC500' , errorMessage : '서버 오류가 발생했습니다.' , data : null } ,
64+ success : null ,
65+ } )
66+ public async listMySchedules (
67+ @Request ( ) req : ExpressRequest ,
68+ @Query ( ) month ?: string , // "YYYY-MM"
69+ ) : Promise < TsoaSuccessResponse < any > > {
70+ const userUuid = ( req as any ) . user ?. id as string ;
71+
72+ console . log ( "token userId =" , userUuid ) ;
73+ console . log ( "month =" , month ) ;
74+
75+ const data = await userAlbaScheduleService . listMySchedules ( userUuid , { month } ) ;
76+
77+ this . setStatus ( 200 ) ;
78+ return new TsoaSuccessResponse ( data ) ;
79+ }
80+
81+ /**
82+ * 내 유저 알바 스케줄 단건 조회(상세)
83+ */
84+ @Security ( 'jwt' )
85+ @Get ( '{userAlbaScheduleId}' )
86+ @SuccessResponse ( 200 , '유저 알바 스케줄 단건 조회 성공' )
87+ @Response < TsoaFailResponse < any > > ( 401 , 'Unauthorized' , {
88+ resultType : 'FAIL' as any ,
89+ error : { errorCode : 'EC401' , errorMessage : '인증이 필요합니다.' , data : null } ,
90+ success : null ,
91+ } )
92+ @Response < TsoaFailResponse < any > > ( 404 , 'Not Found' , {
93+ resultType : 'FAIL' as any ,
94+ error : { errorCode : 'EC404' , errorMessage : '스케줄을 찾을 수 없습니다.' , data : null } ,
95+ success : null ,
96+ } )
97+ @Response < TsoaFailResponse < any > > ( 500 , 'Internal Server Error' , {
98+ resultType : 'FAIL' as any ,
99+ error : { errorCode : 'EC500' , errorMessage : '서버 오류가 발생했습니다.' , data : null } ,
100+ success : null ,
101+ } )
102+ public async getMySchedule (
103+ @Request ( ) req : ExpressRequest ,
104+ @Path ( ) userAlbaScheduleId : string ,
105+ ) : Promise < TsoaSuccessResponse < any > > {
106+ const userUuid = ( req as any ) . user ?. id as string ;
107+
108+ const schedule = await userAlbaScheduleService . getMyScheduleById ( userUuid , userAlbaScheduleId ) ;
109+
110+ this . setStatus ( 200 ) ;
111+ return new TsoaSuccessResponse ( schedule ) ;
112+ }
113+
114+
115+
41116 /*
42117 * 유저 알바 스케줄 등록 API
43118 * @param request - Express 요청 객체
0 commit comments