-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi-docs.json
More file actions
1 lines (1 loc) · 15.6 KB
/
api-docs.json
File metadata and controls
1 lines (1 loc) · 15.6 KB
1
{"openapi":"3.1.0","info":{"title":"매듭(Maedeup) API","description":"실시간 이벤트 플랫폼 API 문서","contact":{"name":"Maedeup Team","email":"taejin0416@koreatech.ac.kr"},"license":{"name":"MIT License","url":"https://opensource.org/licenses/MIT"},"version":"v1.0.0"},"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"security":[{"basicAuth":[]}],"tags":[{"name":"Admin Event","description":"관리자 이벤트 관리 API"},{"name":"Event","description":"이벤트 관련 API"}],"paths":{"/admin/events/{eventId}":{"put":{"tags":["Admin Event"],"summary":"이벤트 수정","description":"기존 이벤트의 정보를 수정합니다.","operationId":"updateEvent","parameters":[{"name":"eventId","in":"path","description":"이벤트 ID","required":true,"schema":{"type":"integer","format":"int64"},"example":1}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventUpdateRequestDto"}}},"required":true},"responses":{"200":{"description":"이벤트 수정 성공"},"400":{"description":"잘못된 요청 데이터"},"401":{"description":"인증되지 않은 사용자"},"403":{"description":"관리자 권한 필요"},"404":{"description":"이벤트를 찾을 수 없음"},"500":{"description":"서버 오류"}}},"delete":{"tags":["Admin Event"],"summary":"이벤트 삭제","description":"이벤트를 삭제합니다. 관련된 참여 기록도 함께 삭제됩니다.","operationId":"deleteEvent","parameters":[{"name":"eventId","in":"path","description":"이벤트 ID","required":true,"schema":{"type":"integer","format":"int64"},"example":1}],"responses":{"204":{"description":"이벤트 삭제 성공"},"401":{"description":"인증되지 않은 사용자"},"403":{"description":"관리자 권한 필요"},"404":{"description":"이벤트를 찾을 수 없음"},"500":{"description":"서버 오류"}}}},"/events/{eventId}/participate":{"post":{"tags":["Event"],"summary":"이벤트 참여","description":"특정 이벤트에 참여합니다. 인증된 사용자만 참여 가능합니다.","operationId":"participateInEvent","parameters":[{"name":"eventId","in":"path","description":"이벤트 ID","required":true,"schema":{"type":"integer","format":"int64"},"example":1}],"responses":{"200":{"description":"이벤트 참여 성공"},"400":{"description":"이미 참여한 이벤트이거나 참여 조건에 맞지 않음"},"401":{"description":"인증되지 않은 사용자"},"404":{"description":"이벤트를 찾을 수 없음"},"500":{"description":"서버 오류"}}}},"/admin/events":{"post":{"tags":["Admin Event"],"summary":"이벤트 생성","description":"새로운 이벤트를 생성합니다. 선착순 또는 추첨 이벤트를 생성할 수 있습니다.","operationId":"createEvent","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventCreateRequestDto"}}},"required":true},"responses":{"201":{"description":"이벤트 생성 성공"},"400":{"description":"잘못된 요청 데이터"},"401":{"description":"인증되지 않은 사용자"},"403":{"description":"관리자 권한 필요"},"500":{"description":"서버 오류"}}}},"/admin/events/{eventId}/draw":{"post":{"tags":["Admin Event"],"summary":"추첨 실행","description":"추첨 이벤트의 당첨자를 추첨합니다. 추첨 이벤트에만 사용 가능합니다.","operationId":"drawWinners","parameters":[{"name":"eventId","in":"path","description":"이벤트 ID","required":true,"schema":{"type":"integer","format":"int64"},"example":1}],"responses":{"200":{"description":"추첨 실행 성공"},"400":{"description":"추첨 이벤트가 아니거나 추첨 조건에 맞지 않음"},"401":{"description":"인증되지 않은 사용자"},"403":{"description":"관리자 권한 필요"},"404":{"description":"이벤트를 찾을 수 없음"},"500":{"description":"서버 오류"}}}},"/events":{"get":{"tags":["Event"],"summary":"이벤트 목록 조회","description":"페이지네이션된 이벤트 목록을 조회합니다.","operationId":"getAllEvents","parameters":[{"name":"page","in":"query","description":"페이지 번호 (0부터 시작)","required":false,"schema":{"type":"integer","format":"int32","default":0},"example":0},{"name":"size","in":"query","description":"페이지 크기","required":false,"schema":{"type":"integer","format":"int32","default":20},"example":20},{"name":"sort","in":"query","description":"정렬 조건 (예: id,desc)","required":false,"schema":{"type":"string"},"example":"id,desc"}],"responses":{"200":{"description":"이벤트 목록 조회 성공","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PageEventListResponseDto"}}}},"400":{"description":"잘못된 요청","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PageEventListResponseDto"}}}},"500":{"description":"서버 오류","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PageEventListResponseDto"}}}}}}},"/events/{eventId}":{"get":{"tags":["Event"],"summary":"이벤트 상세 조회","description":"특정 이벤트의 상세 정보를 조회합니다.","operationId":"getEventDetails","parameters":[{"name":"eventId","in":"path","description":"이벤트 ID","required":true,"schema":{"type":"integer","format":"int64"},"example":1}],"responses":{"200":{"description":"이벤트 상세 조회 성공","content":{"*/*":{"schema":{"$ref":"#/components/schemas/EventDetailResponseDto"}}}},"404":{"description":"이벤트를 찾을 수 없음","content":{"*/*":{"schema":{"$ref":"#/components/schemas/EventDetailResponseDto"}}}},"500":{"description":"서버 오류","content":{"*/*":{"schema":{"$ref":"#/components/schemas/EventDetailResponseDto"}}}}}}},"/events/{eventId}/my/participation":{"get":{"tags":["Event"],"summary":"특정 이벤트 참여 내역 조회","description":"특정 이벤트에 대한 내 참여 내역을 조회합니다.","operationId":"getMyParticipationForEvent","parameters":[{"name":"eventId","in":"path","description":"이벤트 ID","required":true,"schema":{"type":"integer","format":"int64"},"example":1}],"responses":{"200":{"description":"참여 내역 조회 성공","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MyParticipationResponseDto"}}}},"401":{"description":"인증되지 않은 사용자","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MyParticipationResponseDto"}}}},"404":{"description":"참여 기록을 찾을 수 없음","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MyParticipationResponseDto"}}}},"500":{"description":"서버 오류","content":{"*/*":{"schema":{"$ref":"#/components/schemas/MyParticipationResponseDto"}}}}}}},"/events/my/participations":{"get":{"tags":["Event"],"summary":"내 참여 내역 조회","description":"로그인한 사용자의 모든 이벤트 참여 내역을 조회합니다.","operationId":"getMyParticipations","responses":{"200":{"description":"참여 내역 조회 성공","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MyParticipationResponseDto"}}}}},"401":{"description":"인증되지 않은 사용자","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MyParticipationResponseDto"}}}}},"500":{"description":"서버 오류","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MyParticipationResponseDto"}}}}}}}},"/events/my/notifications":{"get":{"tags":["Event"],"summary":"내 알림 조회","description":"로그인한 사용자의 알림을 조회합니다.","operationId":"getMyNotifications","responses":{"200":{"description":"알림 조회 성공","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NotificationResponseDto"}}}}},"401":{"description":"인증되지 않은 사용자","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NotificationResponseDto"}}}}},"500":{"description":"서버 오류","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NotificationResponseDto"}}}}}}}},"/admin/events/{eventId}/participants":{"get":{"tags":["Admin Event"],"summary":"이벤트 참여자 목록 조회","description":"특정 이벤트의 참여자 목록을 조회합니다.","operationId":"getEventParticipants","parameters":[{"name":"eventId","in":"path","description":"이벤트 ID","required":true,"schema":{"type":"integer","format":"int64"},"example":1}],"responses":{"200":{"description":"참여자 목록 조회 성공","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ParticipantResponseDto"}}}}},"401":{"description":"인증되지 않은 사용자","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ParticipantResponseDto"}}}}},"403":{"description":"관리자 권한 필요","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ParticipantResponseDto"}}}}},"404":{"description":"이벤트를 찾을 수 없음","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ParticipantResponseDto"}}}}},"500":{"description":"서버 오류","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ParticipantResponseDto"}}}}}}}},"/events/participations/{participationId}":{"delete":{"tags":["Event"],"summary":"참여 취소","description":"이벤트 참여를 취소합니다.","operationId":"cancelParticipation","parameters":[{"name":"participationId","in":"path","description":"참여 ID","required":true,"schema":{"type":"integer","format":"int64"},"example":1}],"responses":{"200":{"description":"참여 취소 성공"},"400":{"description":"취소할 수 없는 참여 상태"},"401":{"description":"인증되지 않은 사용자"},"404":{"description":"참여 기록을 찾을 수 없음"},"500":{"description":"서버 오류"}}}}},"components":{"schemas":{"EventUpdateRequestDto":{"type":"object","description":"이벤트 수정 요청 데이터","properties":{"title":{"type":"string","description":"이벤트 제목","example":"수정된 이벤트 제목","minLength":1},"description":{"type":"string","description":"이벤트 설명","example":"수정된 이벤트 설명입니다."},"startTime":{"type":"string","format":"date-time","description":"이벤트 시작 시간","example":"2024-12-25T10:00:00"}},"required":["startTime","title"]},"EventCreateRequestDto":{"type":"object","description":"이벤트 생성 요청 데이터","properties":{"title":{"type":"string","description":"이벤트 제목","example":"특별 할인 이벤트","minLength":1},"description":{"type":"string","description":"이벤트 설명","example":"선착순 100명에게 50% 할인 쿠폰을 드립니다."},"eventType":{"type":"string","description":"이벤트 타입","enum":["FCFS","LOTTERY"],"example":"FCFS"},"startTime":{"type":"string","format":"date-time","description":"이벤트 시작 시간","example":"2024-12-25T10:00:00"},"maxParticipants":{"type":"integer","format":"int32","description":"최대 참여자 수 (선착순 이벤트용)","example":100},"endTime":{"type":"string","format":"date-time","description":"이벤트 종료 시간 (추첨 이벤트용)","example":"2024-12-25T23:59:59"},"drawTime":{"type":"string","format":"date-time","description":"추첨 시간 (추첨 이벤트용)","example":"2024-12-26T10:00:00"},"winnerCount":{"type":"integer","format":"int32","description":"당첨자 수 (추첨 이벤트용)","example":10}},"required":["eventType","startTime","title"]},"EventListResponseDto":{"type":"object","description":"이벤트 목록 응답","properties":{"eventId":{"type":"integer","format":"int64","description":"이벤트 ID","example":1},"title":{"type":"string","description":"이벤트 제목","example":"특별 할인 이벤트"},"eventType":{"type":"string","description":"이벤트 타입","enum":["FCFS","LOTTERY"],"example":"FCFS"},"startTime":{"type":"string","format":"date-time","description":"이벤트 시작 시간","example":"2024-12-25T10:00:00"}}},"PageEventListResponseDto":{"type":"object","properties":{"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int32"},"size":{"type":"integer","format":"int32"},"content":{"type":"array","items":{"$ref":"#/components/schemas/EventListResponseDto"}},"number":{"type":"integer","format":"int32"},"sort":{"$ref":"#/components/schemas/SortObject"},"pageable":{"$ref":"#/components/schemas/PageableObject"},"first":{"type":"boolean"},"last":{"type":"boolean"},"numberOfElements":{"type":"integer","format":"int32"},"empty":{"type":"boolean"}}},"PageableObject":{"type":"object","properties":{"offset":{"type":"integer","format":"int64"},"sort":{"$ref":"#/components/schemas/SortObject"},"pageSize":{"type":"integer","format":"int32"},"paged":{"type":"boolean"},"pageNumber":{"type":"integer","format":"int32"},"unpaged":{"type":"boolean"}}},"SortObject":{"type":"object","properties":{"empty":{"type":"boolean"},"sorted":{"type":"boolean"},"unsorted":{"type":"boolean"}}},"EventDetailResponseDto":{"type":"object","description":"이벤트 상세 응답","properties":{"eventId":{"type":"integer","format":"int64","description":"이벤트 ID","example":1},"title":{"type":"string","description":"이벤트 제목","example":"특별 할인 이벤트"},"description":{"type":"string","description":"이벤트 설명","example":"선착순 100명에게 50% 할인 쿠폰을 드립니다."},"eventType":{"type":"string","description":"이벤트 타입","enum":["FCFS","LOTTERY"],"example":"FCFS"},"startTime":{"type":"string","format":"date-time","description":"이벤트 시작 시간","example":"2024-12-25T10:00:00"},"maxParticipants":{"type":"integer","format":"int32","description":"최대 참여자 수 (선착순 이벤트)","example":100},"endTime":{"type":"string","format":"date-time","description":"이벤트 종료 시간 (추첨 이벤트)","example":"2024-12-25T23:59:59"},"drawTime":{"type":"string","format":"date-time","description":"추첨 시간 (추첨 이벤트)","example":"2024-12-26T10:00:00"},"winnerCount":{"type":"integer","format":"int32","description":"당첨자 수 (추첨 이벤트)","example":10}}},"MyParticipationResponseDto":{"type":"object","description":"내 참여 내역 응답","properties":{"participationId":{"type":"integer","format":"int64","description":"참여 ID","example":1},"eventId":{"type":"integer","format":"int64","description":"이벤트 ID","example":1},"eventTitle":{"type":"string","description":"이벤트 제목","example":"특별 할인 이벤트"},"status":{"type":"string","description":"참여 상태","enum":["SUCCESS","FAIL","PENDING","CANCELED"],"example":"SUCCESS"},"participatedAt":{"type":"string","format":"date-time","description":"참여 시간","example":"2024-12-25T10:30:00"}}},"NotificationResponseDto":{"type":"object","description":"알림 응답","properties":{"notificationId":{"type":"integer","format":"int64","description":"알림 ID","example":1},"message":{"type":"string","description":"알림 메시지","example":"이벤트에 당첨되었습니다!"},"isRead":{"type":"boolean","description":"읽음 여부","example":false},"createdAt":{"type":"string","format":"date-time","description":"생성 시간","example":"2024-12-25T10:30:00"}}},"ParticipantResponseDto":{"type":"object","description":"참여자 정보 응답","properties":{"participationId":{"type":"integer","format":"int64","description":"참여 ID","example":1},"userId":{"type":"integer","format":"int64","description":"사용자 ID","example":1},"username":{"type":"string","description":"사용자 이름","example":"홍길동"},"status":{"type":"string","description":"참여 상태","enum":["SUCCESS","FAIL","PENDING","CANCELED"],"example":"SUCCESS"},"participatedAt":{"type":"string","format":"date-time","description":"참여 시간","example":"2024-12-25T10:30:00"}}}},"securitySchemes":{"basicAuth":{"type":"http","description":"Basic Authentication","scheme":"basic"}}}}