Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be/bugfix/#587 채팅 메시지 조회 시 카드도 같이 보여야 함 #588

Conversation

kimyu0218
Copy link
Collaborator

@kimyu0218 kimyu0218 commented Feb 28, 2024

🔮 resolved #587

변경사항

채팅 메시지 조회 시 카드도 같이 조회하도록 수정
body[-1] : 타로 결과 / body[-2] : 타로 카드 이미지 url

고민과 해결 과정

(선택) 테스트 결과

[
  { 
     "isHost": true, 
     "message": "어떤 고민이 있어?"
   },
  { 
    "isHost": false, 
    "message": "오늘 운세를 알고 싶어"
  },
  {
     "isHost": true,
     "message": "https://kr.object.ncloudstorage.com/magicconch/basic/0.jpg"
  },
  { 
    "isHost": true, 
    "message": "0번 카드에 대한 해설입니다."
  }
]

path alias 설정 반영
채팅방에서 타로 결과를 참조해야 하므로 아이디가 아닌 레코드를 리턴하도록
수정
- 타로 해설이 채팅 메시지, 타로 결과에 각각 저장됨
- 중복으로 저장되는 것을 막기 위해 result 필드 추가
- 하나의 방에는 하나의 타로 결과만 존재할 수 있으므로 result 필드를 통해
  타로 결과 참조
- 채팅 메시지 조회 시 타로 결과를 함께 불러와야 함
- 타로 결과 레코드를 채팅 메시지 형태로 변환하기 위한 static 메서드 정의
채팅 메시지 조회 시 타로 결과 테이블을 조회하여 타로 결과와 함께 반환하도록 수정
result 속성을 추가하여 타로 결과 레코드를 저장할 수 있도록 구현
- 이전에는 타로 결과 아이디만 필요하여 아이디만 반환함
- 채팅방을 생성할 때 타로 결과 레코드가 필요하기 때문에 반환형 및 함수명
  수정
@kimyu0218 kimyu0218 marked this pull request as ready for review March 1, 2024 09:58
Copy link
Collaborator

@Doosies Doosies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍 👍 👍 👍

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이쪽 타입 선언을 공통 라이브러리로 빼놨는데, 충돌나겠다
이거 내 쪽에서 수정할게

@kimyu0218 kimyu0218 merged commit e7e15d0 into dev Mar 1, 2024
@kimyu0218 kimyu0218 deleted the BE/bugfix/#587-채팅-메시지-조회-시-카드도-같이-보여야-함 branch March 1, 2024 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐞 채팅 메시지 조회 시 카드도 같이 보여야 함
3 participants