약 성분순 정렬
: 공공데이터 api에서 받아와 저장하는 약 정보에는 약 성분이 itemname에 들어있는 경우도 있고 chart에 들어있는 경우도 있고 성분을 따로 검색해서 보여주기가 애매해서 medicine 엔티티에 성분 타입을 구분할 수 있는 int ingredientType 을 추가했습니다. (1: 메틸페니데이트 염산염, 2: 아토목세틴 염산염, 3: 클로니딘 염산염).
약 모양으로 검색 시 제형 처리
: 약 성분순 정렬과 마찬가지로 제형 또한 정보가 하나로 모아져있지 않아서, medicine 엔티티에 제형 타입을 구분할 수 있는 int tabletType을 추가했습니다. (1: 정제, 2: 경질캡슐, 3: 연질캡슐)
약 리뷰 responsedto custom paging
: 약 리뷰 또한 다은님께서 작성해주신 pagingresponse를 사용하도록 수정했습니다. 응답값은 다음과 같습니다.
💻 구현 내용
약 성분순 정렬 : 공공데이터 api에서 받아와 저장하는 약 정보에는 약 성분이 itemname에 들어있는 경우도 있고 chart에 들어있는 경우도 있고 성분을 따로 검색해서 보여주기가 애매해서 medicine 엔티티에 성분 타입을 구분할 수 있는
int ingredientType
을 추가했습니다. (1: 메틸페니데이트 염산염, 2: 아토목세틴 염산염, 3: 클로니딘 염산염).약 모양으로 검색 시 제형 처리 : 약 성분순 정렬과 마찬가지로 제형 또한 정보가 하나로 모아져있지 않아서, medicine 엔티티에 제형 타입을 구분할 수 있는
int tabletType
을 추가했습니다. (1: 정제, 2: 경질캡슐, 3: 연질캡슐)약 리뷰 responsedto custom paging : 약 리뷰 또한 다은님께서 작성해주신
pagingresponse
를 사용하도록 수정했습니다. 응답값은 다음과 같습니다.약 리뷰 작성 시 해당 약에 대한 별점 실시간 반영 : 사용자들이 약에 대해 리뷰를 작성할 때마다 해당 약에 대한 rating에 반영되도록 수정하였습니다.
약 리뷰 도움돼요 한 번 누르면 +1, 다시 누르면 -1 : 한 번 클릭하면 +1, 다시 누르면 취소되도록 수정했습니다.
🛠️ 개발 오류 사항
{{host}}/api/v1/medicines/reviews
해당 api에다음과 같이 요청값을 넣을 경우 db에는
content가 요청값과 동일하게 저장되는데, postman으로 테스트 시 응답값이
다음과 같이 반환됩니다. 관련 매퍼와 컨트롤러, 서비스 구현체 등 확인해보았지만 이유를 찾지 못했습니다..!
🗣️ For 리뷰어
close #44