コード例 #1
0
  @POST
  @Path("{id}")
  public int createView(@PathParam("id") int hostId, @QueryParam("visitor_id") int visitorId) {
    checkValidity(visitorId);

    return viewDao.createView(hostId, visitorId);
  }
コード例 #2
0
  /** Returns 10 visitors with date in the order in which they recently visited. */
  @GET
  @Path("{id}")
  public List<View> viewList(@PathParam("id") int hostId) {
    checkValidity(hostId);

    return viewDao.getLatest10Visitors(hostId);
  }
コード例 #3
0
 /** Returns record count of each table in the database. */
 @GET
 @Path("view-counts")
 public List<Integer> viewCount() {
   return viewDao.getAllViewCounts();
 }
コード例 #4
0
 /** Clears redundant data in the database. */
 @POST
 @Path("clear")
 public String clear() {
   viewDao.clear();
   return "Success";
 }