Skip to content

Commit

Permalink
feat : 그룹 초대 삭제 컨트롤러 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
seokho-1116 committed Jun 6, 2024
1 parent 7d7e941 commit 11f50f7
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,35 @@ ResponseEntity<ApiSpec<String>> acceptGroupInvitation(
Long groupId
);

@Operation(
summary = "보낸 그룹 초대 삭제 ",
description = "그룹장이 보낸 그룹 초대를 삭제한다. 그룹장만 그룹 초대를 삭제할 수 있다.",
security = {@SecurityRequirement(name = "user_token")},
tags = {"member group"}
)
@ApiResponses(value = {
@ApiResponse(
responseCode = "200",
description = "처리 완료"
),
@ApiResponse(
responseCode = "403",
description = "그룹장이 아닌 경우 예외가 발생한다.",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))
),
@ApiResponse(
responseCode = "404",
description = "그룹 초대를 찾을 수 없는 경우 발생한다.",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))
)
})
ResponseEntity<ApiSpec<String>> deleteGroupInvite(
Long memberId,

@Parameter(in = ParameterIn.PATH, description = "보낸 그룹 초대 아이디", required = true)
Long groupInviteId
);

@Operation(
summary = "그룹 요청 거부",
description = "특정 그룹으로부터 초대 요청을 거부한다.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ public ResponseEntity<ApiSpec<String>> acceptGroupInvitation(
);
}

@DeleteMapping(value = "/sending-invites/{group_invite_id}")
public ResponseEntity<ApiSpec<String>> deleteGroupInvite(
@AuthenticationPrincipal final Long memberId,
@PathVariable("group_invite_id") final Long groupInviteId
) {
memberGroupCommandService.deleteGroupInvite(memberId, groupInviteId);

return ResponseEntity.ok(
ApiSpec.empty(
SuccessCode.SUCCESS
)
);
}

@DeleteMapping(value = "/{group_id}/member/{target_id}/reject")
public ResponseEntity<ApiSpec<String>> rejectGroupInvitation(
@AuthenticationPrincipal final Long memberId,
Expand Down

0 comments on commit 11f50f7

Please sign in to comment.