-
Notifications
You must be signed in to change notification settings - Fork 1
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
(데이터베이스) 리뷰 기능 개발 #42
Comments
Review Table
이렇게 필드가 구성되어 있는데 추가로 넣을 컬럼이 뭐가 있을까요? |
오 감사합니다! 해당 내용들은 FK인 UserOrderDetail에 모두 담겨있어서 // (GET) https://eat-da.com:8000/api/review/{storeId}
data : [{
"id": 1234,
"imageUrl": "https://eat-da.com",
"star": 4,
"content": "맛이 좋네요.",
"createdBy": "홍**",
"menuName": "허니콤보 외 2건",
"storeName": "교촌치킨",
"orderDate": "이번주"
}, {
"id": 1235,
"imageUrl": "https://eat-da.com",
"star": 4,
"content": "맛이 좋네요.",
"createdBy": "홍**",
"menuName": "허니콤보 외 2건",
"storeName": "교촌치킨",
"orderDate": "이번주"
}, {
"id": 1236,
"imageUrl": "https://eat-da.com",
"star": 4,
"content": "맛이 좋네요.",
"createdBy": "홍**",
"menuName": "허니콤보 외 2건",
"storeName": "교촌치킨",
"orderDate": "이번주"
}] |
리뷰 테스트
추가 테스트 필요 작업이 있으면 아래 체크박스를 추가해주세요. |
데이터를 넣어주면 현재 날짜로부터 얼마나 시간이 지났는지 나타냄.
// (POST) https://eat-da.com:8000/api/review/{userOrderDetailId}
// 리뷰 작성
// (DELETE) https://eat-da.com:8000/api/review/visible/{reviewId}
// 리뷰 삭제 (숨기기)
// (GET) https://eat-da.com:8000/api/review/{reviewId}
// 리뷰 1개 가져오기 |
자바에서 코틀린 컴패니언 객체에 접근할 때 기존 자바 문법과 동일하게 접근시키기 위해 @JvmStatic 어노테이션을 추가해줌.
가게 상세 페이지에 들어갔을 때 리뷰 화면을 기획해봤습니다
항상 고생많으십니다!! |
|
queryFactory를 한번만 생성시켜놓고 가져다 쓰기 위해서
(GET) localhost:8080/api/review/{storeId}?page=123
// 예시 (GET) localhost:8080/api/review/{storeId}?page=123
// 최신순으로 나옵니다. page를 이용해서 가져오기 첫번째 리뷰가 0부터 시작
{
"status": 200,
"data": [
{
"id": 2,
"imageUrl": null,
"star": 3,
"content": "음식이 친절하고 사장님이 맛있어요.",
"createdBy": "g*********",
"menuName": [
{
"id": 2,
"name": "짜장면"
}
],
"orderDate": "2023-01-18T01:06:52",
"visible": false,
"relativeDate": "2분 전"
},
{
"id": 1,
"imageUrl": null,
"star": 5,
"content": "맛있네요",
"createdBy": "g********",
"menuName": [
{
"id": 1,
"name": "마라탕"
}
],
"orderDate": "2023-01-18T01:06:52",
"visible": false,
"relativeDate": "2분 전"
}
]
} |
(POST) localhost:8080/api/review/{userOrderDetailId}
// (DELETE) https://eat-da.com:8000/api/review/visible/{reviewId}
// 리뷰 삭제 (숨기기)
{
"status": 200,
"data": "OK"
} 🤓 테스트
|
확인했습니다! 회의 끝나자마자 작업하는 당신은... 감사합니다 최고 👍 |
// (GET) https://eat-da.com:8000/api/review/select/{reviewId}
// 리뷰 1개 가져오기
{
"status": 200,
"data": {
"id": 1,
"imageUrl": null,
"star": 5,
"content": "맛있네요",
"createdBy": "g********",
"menuName": [
{
"id": 1,
"name": "마라탕"
},
{
"id": 3,
"name": "탕수육"
}
],
"orderDate": "2023-01-18T21:21:18",
"visible": true,
"relativeDate": "56초 전"
}
} 🤓 테스트
|
위 api에서 page에 나오는 리뷰의 갯수는 고정적인가요? ex) page=1&size=10 |
네 size도 받을 수 있도록 설정해놓을게요. |
빠른 답변 앤 수정 감사합니다!! |
리뷰 기능이 활성화 되어야 앱에 생동감이 생길듯하다.
The text was updated successfully, but these errors were encountered: