Skip to content

Commit

Permalink
[fix] 이미지 처리 요청 생성 api/photo-request return 값 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
pjw-redt committed Aug 11, 2024
1 parent f1802c2 commit 7444ed1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ public class PhotoRequestController {
@ApiResponse(responseCode = "404", description = "유저를 찾지 못했을 때")
})
@PostMapping
public APIResponse<Void> createImage(@Parameter(hidden = true) @PuangUser User user, @RequestBody @Valid CreateImageDto dto) {
photoRequestService.createImage(dto, user.getId());
return APIResponse.success(null, ResponseCode.PHOTO_REQUEST_CREATE_SUCCESS.getMessage());
public APIResponse<Long> createImage(@Parameter(hidden = true) @PuangUser User user, @RequestBody @Valid CreateImageDto dto) {
return APIResponse.success(photoRequestService.createImage(dto, user.getId()), ResponseCode.PHOTO_REQUEST_CREATE_SUCCESS.getMessage());
}

// 유저의 전체 사진 리스트 조회
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

public interface PhotoRequestService {
//이미지 처리 요청 생성 (RabbitMQ호출)
void createImage(CreateImageDto dto, Long userId);
Long createImage(CreateImageDto dto, Long userId);

//유저의 전체 사진 리스트 조회
List<String> getRequestImages(Long userId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class PhotoRequestServiceImpl implements PhotoRequestService {
//이미지 처리 요청 생성 (RabbitMQ호출)
@Override
@Transactional
public void createImage(CreateImageDto dto, Long userId){
public Long createImage(CreateImageDto dto, Long userId){
User user = userRepository.findById(userId).orElseThrow(() -> new BaseException(ResponseCode.USER_NOT_FOUND));
// PhotoRequest 생성
PhotoRequest request = PhotoRequest.builder()
Expand Down Expand Up @@ -80,6 +80,8 @@ public void createImage(CreateImageDto dto, Long userId){
// Redis에 userId 저장하고, userId로 requestId 추적할 수 있도록 함
redisTemplate.opsForSet().add(ConstantUtil.USER_ID_KEY, userId);
redisTemplate.opsForSet().add(userId.toString(), request.getId());

return request.getId();
}

// 유저의 전체 사진 리스트 조회
Expand Down

0 comments on commit 7444ed1

Please sign in to comment.