Skip to content

Commit

Permalink
Merge pull request #66 from BbeumbungE/hotfix/BACK-252
Browse files Browse the repository at this point in the history
fix: 랭킹 데이터 미존재시 TOP 게시물 null 값 반환 및 그림 변환하기 응답값 수정 [BACK-252]
  • Loading branch information
Fishphobiagg authored Sep 27, 2023
2 parents e5d1aca + dd6a240 commit 9c2ea1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.siliconvalley.domain.canvas.service;

import com.siliconvalley.domain.canvas.domain.Canvas;
import com.siliconvalley.domain.canvas.dto.CanvasConvertResponse;
import com.siliconvalley.domain.image.service.S3ImageUploadService;
import com.siliconvalley.domain.post.service.RankCachingService;
import com.siliconvalley.domain.rabbitMQ.code.RabbitMQCode;
Expand All @@ -27,7 +28,6 @@ public Response updateSketchAndCanvas(Canvas canvas, String newSketch, Long prof
s3ImageUploadService.deleteImage(canvas.getSketch());
canvas.updateSketch(newSketch);
convertRequestSender.sendSketchConversionRequest(newSketch, canvas.getId(), profileId, canvas.getSubject());
return Response.of(RabbitMQCode.CONVERSION_RESPONSE_SUCCESS, rankCachingService.getTopPostThisWeek(canvas.getSubject().getId()));
return Response.of(RabbitMQCode.CONVERSION_RESPONSE_SUCCESS, new CanvasConvertResponse(canvas.getId(), rankCachingService.getTopPostThisWeek(canvas.getSubject().getId())));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void cachingRankToRedis(RankingCachingDto rankingCachingDto){
public String getTopPostThisWeek(Long subjectId){
RankingCachingDto rankingCachingDto = redisTemplate.opsForList().index(generateRedisKey(subjectId), -1);
if (rankingCachingDto.getRankerList().isEmpty()){
return "ranking is empty";
return null;
}
return rankingCachingDto.getRankerList().get(0).getCanvasUrl();
}
Expand Down

0 comments on commit 9c2ea1b

Please sign in to comment.