Skip to content

Instantly share code, notes, and snippets.

@JRJurman
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save JRJurman/4d3e80c05954bf6047da to your computer and use it in GitHub Desktop.

Select an option

Save JRJurman/4d3e80c05954bf6047da to your computer and use it in GitHub Desktop.
Restful API
public interface JobServices {
// POST: /jobs
/**
* result: a new job post is created, belonging to the current user
* response: JSON object with same parameters as request, plus newly assigned jobID
* conditions: none
*/
public Job createJob(String title, String location, String description, Boolean isCoop, String startDate);
// GET: /jobs
/**
* result: no change
* response: JSON list of job posts that fit the specified search criteria
* conditions: none
*/
public Job searchJobs(String[] employerIds, String[] keywords, String[] locations, Boolean isCoop, String startDateRange);
// GET: /jobs/{jobId}
/*
* result: no change
* response: JSON object of specified job post
* conditions:
* jobId must already be assigned
*/
public Job readJobPost(String jobId);
// DELETE: /jobs/{jobId}
/*
* result: job post is deleted
* response: JSON object of specified job post
* conditions:
* jobId must already be assigned
* job post must belong to current user
*/
public Job deleteJobPost(String jobId);
// PUT: /jobs/{jobId}
/*
* result: job post is modified with the given data
* response: JSON object of specified job post, after the change
* conditions:
* jobId must already be assigned
* job post must belong to current user
*/
public Job modifyJobPost(String jobId, String title, String location, String description, Boolean isCoop, String startDate);
// PUT: /jobs/{jobId}/save
/*
* result: job post is added to the current user’s list of favourites
* response: JSON list of favorites
* conditions:
* jobId must already be assigned
*/
public Job saveJobPost(String jobId);
// GET: /jobs/saved
/*
* result: no change
* response: JSON list of favourites
* conditions: none
* This will provide a JSON list of job favourites for the current user
*/
public Job getJobFavourites();
// PUT: /jobs/{jobId}/unsave
/*
* result: job post is removed from the current user's list of favourites
* response: JSON list of favourites
* conditions: jobId must already be assigned
*/
public Job removeJobFavourite(String jobId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment