Skip to content
lealdan edited this page Nov 2, 2016 · 5 revisions

##Overview The server-side code specified in the gs-rest-server directory contains a simple java REST server and some helper classes to aid in processing requests from a java client.

##Classes

  • Application.java: Boots a SpringApplication and listens for requests on port 8080. These requests will by handled by the FixMyBugController. The following URL outlines the setup of a SpringBootApplication: http://spring.io/guides/gs/rest-service/
  • FixMyBugController.java: A simple java REST controller that maps requests to a method specified in the URL. When a request is made to the server, this controller processes the request and returns desired data.
  • ServerRequest.java: The wrapper object that will contain all data that is received from the client. Instances of this object are generated in the FixMyBugController "\fix" mapping. They are created by deserializing JSON (a serialized ServerRequest object from the client.) into an instance. The class contains a String of buggy code and an error message.
  • DatabaseEntry.java: A wrapper object that holds data that will be returned from the server. It replicates our master table table structure and holds an (id, errorType, buggyCode, fixedCode, and a count).

####Location The classes listed above are found in the gs-rest-server top-level directory under src/main/java/server

Clone this wiki locally