Skip to content

Shop Review

Joeleely edited this page Oct 23, 2022 · 5 revisions

Shop Review Module

Add Review

Create new review

URL

POST /review

REQUEST BODY

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"
}

success

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"
}

fail

400 (Failed create review)


Edit Review

Edit the review

URL

Put /review

REQUEST BODY

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"
}

success

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"
}

fail

400 ( failed update review )


Delete Review

delete the review

URL

delete /review

REQUEST BODY

REQUEST BODY

Parameter Type Description
Review_ID int Review_ID

EXAMPLE

{
Review_ID = "1"
}

success

RESPONSE 204 (deleted successfully)

fail

400 (error to delete review)


Add Comment

Write comment in the review

URL

post /comment

REQUEST BODY

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"
}

success

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"
}

fail

400 (error to create comment)


Show My Review

See my review by use User_ID

URL

get /myReview

REQUEST BODY

REQUEST BODY

Parameter Type Description
User_ID String User_ID

EXAMPLE

{
User_ID = "03"
}

success

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"
}

fail

404 (Review not found)


Get Restaurant Attribute

Detail like amount rate, amount review

URL

get /ResAttribute

REQUEST BODY

REQUEST BODY

Parameter Type Description
Restaurant_ID int Restaurant_ID

EXAMPLE

{
Restaurant_ID = "3"
}

success

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"
}

fail

`400' ( error to get restaurant attribute)


Edit Comment on the review

edit comments on the review.

URL

put /comment

REQUEST BODY

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"
}

success

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"
}

fail

400 (error to edit comment)


Delete comment on the review

delete comment by comment_ID

URL

delete /id

REQUEST BODY

REQUEST BODY

Parameter Type Description
Comment_ID int comment's id

EXAMPLE

{
 comment_ID: "2",
}

success

204 (deleted successfully)

fail

400 (error to delete comment)


Shop Detail

show detail of shop

URL

get /shopDetail

REQUEST BODY

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"
}

success

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"
}

fail

400 ( error to get Shop's detail )


Shop Image

Get the shop image

URL

get /shopImg

REQUEST BODY

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 ="???"
}

success

RESPONSE

Parameter Type Description
Image Bytea Shop's image

EXAMPLE

{
Image ="???"
}

fail

400 ( error to get image )


Review Image

Image with review

URL

get /type

REQUEST BODY

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 = ???"
}

success

RESPONSE

Parameter Type Description
Image Bytea Review's image

EXAMPLE

{
Image = ???"
}

fail

400 ( error to get image )


Clone this wiki locally