Skip to content

Commit

Permalink
add: stamp get deprecated ver
Browse files Browse the repository at this point in the history
  • Loading branch information
주어진사랑(eojinjoo) committed Apr 28, 2023
1 parent 6bc1b47 commit 5c71509
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ public Stamp findStamp(StampRequest.FindStampRequest findStampRequest) {
.orElseThrow(() -> new BadRequestException(ErrorCode.STAMP_NOT_FOUND.getMessage()));
}

@Transactional(readOnly = true)
public Stamp findStampDeprecated(Long userId, Long missionId) {
return stampRepository.findByUserIdAndMissionId(userId, missionId)
.orElseThrow(() -> new BadRequestException(ErrorCode.STAMP_NOT_FOUND.getMessage()));
}

@Transactional
public Stamp uploadStampDeprecated(
RegisterStampRequest stampRequest,
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/org/sopt/app/presentation/stamp/StampController.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ public ResponseEntity<StampResponse.StampMain> findStampByMissionAndUserId(
return ResponseEntity.status(HttpStatus.OK).body(response);
}

@Operation(summary = "스탬프 조회하기 - DEPRECATED")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "success"),
@ApiResponse(responseCode = "400", description = "no stamp", content = @Content),
@ApiResponse(responseCode = "500", description = "server error", content = @Content)
})
@GetMapping("/mission/{missionId}")
public ResponseEntity<StampResponse.StampMain> findStampByMissionAndUserIdDeprecated(
@AuthenticationPrincipal User user,
@PathVariable Long missionId
) {
val result = stampService.findStampDeprecated(user.getId(), missionId);
val response = stampResponseMapper.of(result);
return ResponseEntity.status(HttpStatus.OK).body(response);
}

@Operation(summary = "스탬프 등록하기 - DEPRECATED")
@PostMapping("/{missionId}")
public ResponseEntity<StampResponse.StampMain> registerStampDeprecated(
Expand Down

0 comments on commit 5c71509

Please sign in to comment.