Skip to content

Commit

Permalink
feat: Logging 레벨 수정, 명세 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsu5582 committed Jul 18, 2024
1 parent d5d87d9 commit f837f9b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class ExceptionResponseHandler {

@ExceptionHandler(CoreaException.class)
public ResponseEntity<ErrorResponse> handleCoreaException(final CoreaException e) {
log.debug("Reaction Game exception [statusCode = {}, errorMessage = {}, cause = {}]", e.getHttpStatus(), e.getMessage(),e.getCause());
log.debug("Corea exception [statusCode = {}, errorMessage = {}, cause = {}]", e.getHttpStatus(), e.getMessage(),e.getCause());
return ResponseEntity.status(e.getHttpStatus())
.body(new ErrorResponse(e.getMessage()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
@RestController
@RequestMapping("/participate")
@RequiredArgsConstructor
public class ParticipateController {
public class ParticipateController implements ParticipationControllerSpecification {
private final ParticipationService participationService;

@PostMapping("/{id}")
public ResponseEntity<Void> participate(@PathVariable final long id, @LoginUser AuthInfo authInfo) {
public ResponseEntity<Void> participate(@PathVariable long id, @LoginUser AuthInfo authInfo) {
participationService.participate(new ParticipationRequest(id,authInfo.getId()));
return ResponseEntity.ok()
.build();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package corea.matching.controller;

import corea.auth.domain.AuthInfo;
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 org.springframework.http.ResponseEntity;

public interface ParticipationControllerSpecification {

@ApiResponses(
value = {
@ApiResponse(responseCode = "404", content = @Content(mediaType = "application/json", examples = {
@ExampleObject(name = "해당하는 방이 없는 경우", value = """
{
"message": "1에 해당하는 방 없습니다."
}
""")
})),
}
)
ResponseEntity<Void> participate(long id, AuthInfo authInfo);
}
5 changes: 5 additions & 0 deletions backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ spring:
datasource:
url: jdbc:h2:mem:database

logging:
level:
root: INFO
corea: DEBUG

springdoc:
swagger-ui:
groups-order: DESC
Expand Down

0 comments on commit f837f9b

Please sign in to comment.