Skip to content

Commit

Permalink
Merge pull request #80 from kookmin-sw/feat/familarity2
Browse files Browse the repository at this point in the history
feat: 이미지 가중치 부여 시점 세분화
  • Loading branch information
KimChanJin97 authored May 17, 2024
2 parents e40b1d4 + 74a69cd commit 8019c47
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
44 changes: 24 additions & 20 deletions src/main/java/capstone/facefriend/chat/aop/ChatAop.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ public class ChatAop {
@Value("${spring.cloud.aws.s3.bucket}")
private String BUCKET_NAME;

public static final int LEVEL_TWO = 5;
public static final int LEVEL_THREE = 10;
public static final int LEVEL_FOUR = 15;
private static final int LEVEL_TWO = 5;
private static final int LEVEL_THREE = 10;
private static final int LEVEL_FOUR = 15;
private static final int LEVEL_FIVE = 20;
private static final int LEVEL_SIX = 25;
private static final int LEVEL_SEVEN = 30;

@Pointcut("execution(* capstone.facefriend.chat.service.MessageService.sendHeart(..))")
private void sendHeart() {
Expand Down Expand Up @@ -157,35 +160,36 @@ public void beforeSaveChatMessage(JoinPoint joinPoint) throws IOException {
Long receiverId = receiver.getId();

switch (chatMessageCount) {
case LEVEL_TWO:
case LEVEL_TWO: // 5
ByteArrayMultipartFile senderGeneratedByLevelTwo = faceInfoService.generateByLevel(senderOrigin, senderId, senderStyleId, 2);
ByteArrayMultipartFile receiverGeneratedByLevelTwo = faceInfoService.generateByLevel(receiverOrigin, receiverId, receiverStyleId, 2);

String senderGeneratedByLevelTwoS3url = bucketService.updateGeneratedByLevel(senderGeneratedByLevelTwo, roomId);
String receiverGeneratedByLevelTwoS3url = bucketService.updateGeneratedByLevel(receiverGeneratedByLevelTwo, roomId);

senderFaceInfoByLevel.setGeneratedByLevelS3url(senderGeneratedByLevelTwoS3url); // dirty check
break;
case LEVEL_THREE: // 10
ByteArrayMultipartFile receiverGeneratedByLevelTwo = faceInfoService.generateByLevel(receiverOrigin, receiverId, receiverStyleId, 2);
String receiverGeneratedByLevelTwoS3url = bucketService.updateGeneratedByLevel(receiverGeneratedByLevelTwo, roomId);
receiverFaceInfoByLevel.setGeneratedByLevelS3url(receiverGeneratedByLevelTwoS3url); // dirty check

case LEVEL_THREE:
break;
case LEVEL_FOUR: // 15
ByteArrayMultipartFile senderGeneratedByLevelThree = faceInfoService.generateByLevel(senderOrigin, senderId, senderStyleId, 3);
ByteArrayMultipartFile receiverGeneratedByLevelThree = faceInfoService.generateByLevel(receiverOrigin, receiverId, receiverStyleId, 3);

String senderGeneratedByLevelThreeS3url = bucketService.updateGeneratedByLevel(senderGeneratedByLevelThree, roomId);
String receiverGeneratedByLevelThreeS3url = bucketService.updateGeneratedByLevel(receiverGeneratedByLevelThree, roomId);

senderFaceInfoByLevel.setGeneratedByLevelS3url(senderGeneratedByLevelThreeS3url); // dirty check
break;
case LEVEL_FIVE: // 20
ByteArrayMultipartFile receiverGeneratedByLevelThree = faceInfoService.generateByLevel(receiverOrigin, receiverId, receiverStyleId, 3);
String receiverGeneratedByLevelThreeS3url = bucketService.updateGeneratedByLevel(receiverGeneratedByLevelThree, roomId);
receiverFaceInfoByLevel.setGeneratedByLevelS3url(receiverGeneratedByLevelThreeS3url); // dirty check

case LEVEL_FOUR:
break;
case LEVEL_SIX: // 25
ByteArrayMultipartFile senderGeneratedByLevelFour = faceInfoService.generateByLevel(senderOrigin, senderId, senderStyleId, 4);
ByteArrayMultipartFile receiverGeneratedByLevelFour = faceInfoService.generateByLevel(receiverOrigin, receiverId, receiverStyleId, 4);

String senderGeneratedByLevelFourS3url = bucketService.updateGeneratedByLevel(senderGeneratedByLevelFour, roomId);
String receiverGeneratedByLevelFourS3url = bucketService.updateGeneratedByLevel(receiverGeneratedByLevelFour, roomId);

senderFaceInfoByLevel.setGeneratedByLevelS3url(senderGeneratedByLevelFourS3url); // dirty check
break;
case LEVEL_SEVEN: // 30
ByteArrayMultipartFile receiverGeneratedByLevelFour = faceInfoService.generateByLevel(receiverOrigin, receiverId, receiverStyleId, 4);
String receiverGeneratedByLevelFourS3url = bucketService.updateGeneratedByLevel(receiverGeneratedByLevelFour, roomId);
receiverFaceInfoByLevel.setGeneratedByLevelS3url(receiverGeneratedByLevelFourS3url); // dirty check
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public Map<String, Object> getChatRoomList(Long memberId) {
Member sender = identifySender(chatRoomMember, memberId);
ChatRoomOpenResponse chatRoomOpenResponse = ChatRoomOpenResponse.of(member, sender, chatRoomMember.getChatRoom(), OPEN_MESSAGE);
chatRoomsOpen.add(chatRoomOpenResponse);

} else if (status == ChatRoom.Status.close) {
Member leftMember = identifyLeftMember(memberId, chatRoomMember);
if (member != leftMember) {
Expand Down

0 comments on commit 8019c47

Please sign in to comment.