Question: The following statement supposedly declares a REST web service method to remove an item from a data repository. When a delete request (for instance .../gallery/1)

The following statement supposedly declares a REST web service method to remove an item from a data repository. When a delete request (for instance .../gallery/1) is issued, the method deletes the item from the data repository and returns the confirmation message as text. If the item is not found, a 404 message is to be returned with an appropriate error message. In case of other errors, a generic 400 error message may be reported along with the detailed error message in plain text format. Response deleteRecord(int id) {} Implement the body of the service class (including the method above) by fully annotating it. Assume that there a class called DBGallery is already provided that takes care of the data layer for you. Boolean DBGallery.deleteltem(int recordId); // The above deletes an item from the repository in the database. // It returns true upon success; and returns false, if the item does not exist. // In case of system errors, in throws an Exception
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
