rating and favorites service in scala and postgres
Scala Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
build
src
.gitignore
README.mkd
Rakefile
bootstrap.sql
pom.xml

README.mkd

Trophy Service

How To Run

  • assumes postgres/you've run the bootstrap.sql file
  • you should straighten out your usernames/passwords

Passwords are located at:

src/main/scala/com/submarinerich/service/trophy/TrophyService.scala:37

Then you start up with:

rake run

It will run on port 8085, and you can see what api options are available.

the api available will be at http://localhost:8085/

API documentation

GET /

POST /fav

make a new favorite

params:
    source (required: Long)
    destination (required: Long)
    category (optional: Long)

POST /unfav

unfavorite something

params:
    source (required: Long)
    destination (required: Long)
    category (optional: Long)

GET /favorites/ source

get all the items that source has favorited where source is a Long

POST /rate

rate something

params:
    source (required: Long)
    destination (required: Long)
    rating (required: Long)

GET /favorites/ item /count

see how many favorites an item has

GET /ratings/ item /count

see how many ratings an item has

GET /ratings/ item /average

get the average rating for item