bounswe / bounswe2017group5

Interestr - Build your own interest-based community
MIT License
6 stars 3 forks source link

Post recommendations backend #184

Closed smddzcy closed 6 years ago

smddzcy commented 6 years ago

About

Implemented a basic post recommendation backend that looks at the data templates in common with other posts.

Changes

Visuals

It's not a visual change, but here are some examples from the returned data:

GET: http://127.0.0.1:8000/api/v1/recommend_posts/ Response:

{"results": [{"owner": 2, "data": [{"question": "Multiselect", "response": "Birds"}, {"question": "Area", "response": "text"}], "id": 2}, {"owner": 2, "data": [{"question": "Text", "response": "text 3"}], "id": 3}]}

GET: http://127.0.0.1:8000/api/v1/recommend_posts/?limit=1 Response:

{"results": [{"owner": 2, "data": [{"question": "Multiselect", "response": "Birds"}, {"question": "Area", "response": "text"}], "id": 2}]}

Testing

smddzcy commented 6 years ago

@triforce930 This branch is magically merged... Let me know if you want me to change anything 😄