-
Notifications
You must be signed in to change notification settings - Fork 18
Shop Review
Create new review
POST /review
REQUEST BODY
| Parameter | Type | Description |
|---|---|---|
| Shop_ID | int | Shop_ID |
| Restaurant_ID | int | Restaurant_ID |
| User_ID | String | User_ID |
| Review_ID | int | Review_ID |
| ReviewDate | DateTime | Post time (YYYY-MM-DD HH:mm:ss) |
| ReviewText | String | Text of review |
| ReviewImage | Bytea | Image with review |
| Amount_Rate | int | Amout of rate |
EXAMPLE
{
Shop_ID : "1"
ResTaurant_ID = "null"
User_ID = "03"
Review_ID = "2"
ReviewDate = "2022-04-15 17:20:46"
ReviewText = "อร่อยมากๆเลยคร้าบบบ~~~"
ReviewImage = "???"
Amount_Rate = "5"
}
RESPONSE
| Parameter | Type | Description |
|---|---|---|
| Shop_ID | int | Shop_ID |
| Restaurant_ID | int | Restaurant_ID |
| User_ID | String | User_ID |
| Review_ID | int | Review_ID |
| ReviewDate | DateTime | Post time (YYYY-MM-DD HH:mm:ss) |
| ReviewText | String | Text of review |
| ReviewImage | Bytea | Image with review |
| Amount_Rate | int | Amout of rate |
| AmountLike | int | Amount of like |
EXAMPLE
{
Shop_ID : "1"
ResTaurant_ID = "null"
User_ID = "03"
Review_ID = "2"
ReviewDate = "2022-04-15 17:20:46"
ReviewText = "อร่อยมากๆเลยคร้าบบบ~~~"
ReviewImage = "03"
Amount_Rate = "5"
AmountLike = "10"
}
400 (Failed create review)
Edit the review
Put /review
REQUEST BODY
| Parameter | Type | Description |
|---|---|---|
| Shop_ID | int | Shop_ID |
| Restaurant_ID | int | Restaurant_ID |
| User_ID | String | User_ID |
| Review_ID | int | Review_ID |
| ReviewDate | DateTime | Post time (YYYY-MM-DD HH:mm:ss) |
| ReviewText | String | Text of review |
| ReviewImage | Bytea | Image with review |
| Amount_Rate | int | Amout of rate |
EXAMPLE
{
Shop_ID : "1"
ResTaurant_ID = "null"
User_ID = "03"
Review_ID = "2"
ReviewDate = "2022-04-15 17:20:46"
ReviewText = "อร่อยมากๆเลยคร้าบบบ~~~"
ReviewImage = "03"
Amount_Rate = "5"
}
RESPONSE
| Parameter | Type | Description |
|---|---|---|
| Shop_ID | int | Shop_ID |
| Restaurant_ID | int | Restaurant_ID |
| User_ID | String | User_ID |
| Review_ID | int | Review_ID |
| ReviewDate | DateTime | Post time (YYYY-MM-DD HH:mm:ss) |
| ReviewText | String | Text of review |
| ReviewImage | Bytea | Image with review |
| Amount_Rate | int | Amout of rate |
| AmountLike | int | Amount of like |
EXAMPLE
{
Shop_ID : "1"
ResTaurant_ID = "null"
User_ID = "03"
Review_ID = "2"
ReviewDate = "2022-04-15 17:20:46"
ReviewText = "อร่อยมากๆเลยคร้าบบบ~~~"
ReviewImage = "03"
Amount_Rate = "5"
AmountLike = "10"
}
400 ( failed update review )
delete the review
delete /review
REQUEST BODY
| Parameter | Type | Description |
|---|---|---|
| Review_ID | int | Review_ID |
EXAMPLE
{
Review_ID = "1"
}
RESPONSE
204 (deleted successfully)
400 (error to delete review)
Write comment in the review
post /comment
REQUEST BODY
| Parameter | Type | Description |
|---|---|---|
| User_ID | String | User_ID |
| Review_ID | int | Review_ID |
| Comment_ID | String | Comment_ID |
| CommentText | String | Comment the review |
| CommentDate | DateTime | Comment time (YYYY-MM-DD HH:mm:ss) |
EXAMPLE
{
User_ID = "03"
Review_ID = "2"
Comment_ID = "1"
CommentText = "จริงคับๆ"
CommentDate = "2022-04-15 17:20:46"
}
RESPONSE
| Parameter | Type | Description |
|---|---|---|
| User_ID | String | User_ID |
| Review_ID | int | Review_ID |
| Comment_ID | String | Comment_ID |
| CommentText | String | Comment the review |
| CommentDate | DateTime | Comment time (YYYY-MM-DD HH:mm:ss) |
| AmountLike | int | Amount of like |
EXAMPLE
{
User_ID = "03"
Review_ID = "2"
Comment_ID = "1"
CommentText = "จริงคับๆ"
CommentDate = "2022-04-15 17:20:46"
AmountLike = "10"
}
400 (error to create comment)
See my review by use User_ID
get /myReview
REQUEST BODY
| Parameter | Type | Description |
|---|---|---|
| User_ID | String | User_ID |
EXAMPLE
{
User_ID = "03"
}
RESPONSE
| Parameter | Type | Description |
|---|---|---|
| Shop_ID | int | Shop_ID |
| Restaurant_ID | int | Restaurant_ID |
| User_ID | String | User_ID |
| Review_ID | int | Review_ID |
| ReviewDate | DateTime | Post time (YYYY-MM-DD HH:mm:ss) |
| ReviewText | String | Text of review |
| Amount_Rate | int | Amout of rate |
| AmountLike | int | Amount of like |
EXAMPLE
{
Shop_ID : "1"
ResTaurant_ID = "null"
User_ID = "03"
Review_ID = "2"
ReviewDate = "2022-04-15 17:20:46"
ReviewText = "อร่อยมากๆเลยคร้าบบบ~~~"
Amount_Rate = "5"
AmountLike = "10"
}
404 (Review not found)
Detail like amount rate, amount review
get /ResAttribute
REQUEST BODY
| Parameter | Type | Description |
|---|---|---|
| Restaurant_ID | int | Restaurant_ID |
EXAMPLE
{
Restaurant_ID = "3"
}
RESPONSE
| Parameter | Type | Description |
|---|---|---|
| Restaurant_ID | int | Restaurant_ID |
| Average_Rate | double | Average_Rate |
| Amount_Review | int | Amount_Review |
EXAMPLE
{
Restaurant_ID = "3"
Average_Rate = "4.2"
Amount_Review = "15"
}
`400' ( error to get restaurant attribute)
edit comments on the review.
put /comment
REQUEST BODY
| Parameter | Type | Description |
|---|---|---|
| Review_ID | int | review's id |
| Comment_ID | int | comment's id |
| User_ID | String | user' id who write on review |
| CommentText | String | comment on review |
| CommentDate | Datetime | date comment (YYYY-MM-DD HH:mm:ss) |
EXAMPLE
{
Review_ID : "4"
Comment_ID: "3"
User_ID : "05"
CommentText:"This is good review, it's help me a lot"
CommentDate:"2022-04-15 17:20:46"
}
RESPONSE
| Parameter | Type | Description |
|---|---|---|
| Review_ID | int | review's id |
| Comment_ID | int | comment's id |
| User_ID | String | user' id write on review |
| CommentText | String | comment on review |
| CommentDate | Datetime | date comment (YYYY-MM-DD HH:mm:ss) |
| AmountLike | int | number of user like comment |
EXAMPLE
{
review_ID : "4",
comment_ID: "3",
user_ID : "06" ,
commentText:"This is good review, it's help me a lot",
commentDate:"2022-04-15 17:20:46",
amountlike : "20"
}
400 (error to edit comment)
delete comment by comment_ID
delete /id
REQUEST BODY
| Parameter | Type | Description |
|---|---|---|
| Comment_ID | int | comment's id |
EXAMPLE
{
comment_ID: "2",
}
204 (deleted successfully)
400 (error to delete comment)
show detail of shop
get /shopDetail
REQUEST BODY
| Parameter | Type | Description |
|---|---|---|
| Shop_ID | int | Shop_ID |
| ShopName | String | name of the shop |
| Type | String | Type of the shop |
| Open | String | Shop's open |
| Close | String | Shpo's close |
| Phone_Num | String | Number of the shop |
| Latitude | String | Shop's latitude |
| Longitude | String | Shop's longitude |
| Address | String | Shop's address |
| Average_Rate | double | Average_Rate |
| Amount_Review | int | Amount_Review |
EXAMPLE
{
Shop_ID = "1"
ShopName = "Joe's photo"
Type = "Restaurant"
Open = "8.00"
Close = "19.00"
Phone_Num = "088-888-8888"
Latitude = "13.7159"
Longitude = "100.417"
Address = "389 bangkok 10100"
Average_Rate = "3.6"
Amount_Review = "15"
}
RESPONSE
| Parameter | Type | Description |
|---|---|---|
| ShopName | String | name of the shop |
| Type | String | Type of the shop |
| Open | String | Shop's open |
| Close | String | Shpo's close |
| Phone_Num | String | Number of the shop |
| Latitude | String | Shop's latitude |
| Longitude | String | Shop's longitude |
| Address | String | Shop's address |
| Average_Rate | double | Average_Rate |
| Amount_Review | int | Amount_Review |
EXAMPLE
{
ShopName = "Joe's photo"
Type = "Restaurant"
Open = "8.00"
Close = "19.00"
Phone_Num = "088-888-8888"
Latitude = "13.7159"
Longitude = "100.417"
Address = "389 bangkok 10100"
Average_Rate = "3.6"
Amount_Review = "15"
}
400 ( error to get Shop's detail )
Get the shop image
get /shopImg
REQUEST BODY
| Parameter | Type | Description |
|---|---|---|
| Shop_ID | int | Shop_ID |
| ShopImage_ID | int | ShopImage_ID |
| Image | Bytea | Shop's image |
EXAMPLE
{
Shop_ID = "1"
ShopImage_ID = "2"
Image ="???"
}
RESPONSE
| Parameter | Type | Description |
|---|---|---|
| Image | Bytea | Shop's image |
EXAMPLE
{
Image ="???"
}
400 ( error to get image )
Image with review
get /type
REQUEST BODY
| Parameter | Type | Description |
|---|---|---|
| Review_ID | int | Review_ID |
| ReviewImage_ID | int | ReviewImage_ID |
| Image | Bytea | Review's image |
EXAMPLE
{
Review_ID = "1"
ReviewImage_ID = "2"
Image = ???"
}
RESPONSE
| Parameter | Type | Description |
|---|---|---|
| Image | Bytea | Review's image |
EXAMPLE
{
Image = ???"
}
400 ( error to get image )