Skip to content

Commit

Permalink
feat: ParticipateApi 작성 완료
Browse files Browse the repository at this point in the history
  • Loading branch information
daeyoung0726 committed Aug 2, 2024
1 parent a64cca6 commit 724a245
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/gible/domain/event/api/EventApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public interface EventApi {

@Operation(summary = "이벤트 등록", description = "이벤트 등록하기 위한 API")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "이벤트 등록 성공",
@ApiResponse(responseCode = "201", description = "이벤트 등록 성공",
content = @Content(mediaType = "application/json", examples = {
@ExampleObject(value = """
{
Expand Down
39 changes: 39 additions & 0 deletions src/main/java/gible/domain/participate/api/ParticipateApi.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package gible.domain.participate.api;

import gible.domain.security.common.SecurityUserDetails;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.ExampleObject;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
Expand All @@ -11,9 +16,43 @@
@Tag(name = "[이벤트 참여 API]", description = "이벤트 참여 관련 API")
public interface ParticipateApi {

@Operation(summary = "이벤트 참여", description = "이벤트 참여하기 위한 API")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "이벤트 참여 성공",
content = @Content(mediaType = "application/json", examples = {
@ExampleObject(value = """
{
"response": "참여 완료."
}
""")
})),
})
ResponseEntity<?> participationEvent(@AuthenticationPrincipal SecurityUserDetails userDetails,
@PathVariable UUID eventId);

@Operation(summary = "사용자가 참여한 이벤트 목록 조회하기", description = "사용자가 참여한 이벤트 목록 조회하기 위한 API")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "참여한 이벤트 리스트 조회하기 성공",
content = @Content(mediaType = "application/json", examples = {
@ExampleObject(value = """
[
{
"event": {
"eventId": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"title": "이벤트1"
}
},
{
"event": {
"eventId": "c56a4180-65aa-42ec-a945-5fd21dec0538",
"title": "이벤트2"
}
}
]
""")
})
)
})
ResponseEntity<?> getAllParticipationEvents(
@AuthenticationPrincipal SecurityUserDetails userDetails);
}

0 comments on commit 724a245

Please sign in to comment.