Skip to content

Commit

Permalink
refactor: 수영 기록 저장 응답 형식 간소화 (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
ywonchae1 committed Jul 15, 2024
1 parent 01986c4 commit f812e19
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,21 @@
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/api/memory")
@RequiredArgsConstructor
@RequestMapping("/api/memory")
public class MemoryController {
private final MemoryService memoryService;

@PostMapping
@Operation(summary = "수영 기록 저장")
public ResponseEntity<ApiResponse<?>> create(
@Valid @RequestBody MemoryCreateRequest memoryCreateRequest) {
public ApiResponse<?> create(@Valid @RequestBody MemoryCreateRequest memoryCreateRequest) {
memoryService.save(memoryCreateRequest);
return ResponseEntity.status(HttpStatus.CREATED)
.body(ApiResponse.success(MemorySuccessType.POST_RESULT_SUCCESS));
return ApiResponse.success(MemorySuccessType.POST_RESULT_SUCCESS);
}
}

0 comments on commit f812e19

Please sign in to comment.