Skip to content
Snippets Groups Projects
Commit 97c630e9 authored by BEAUVAIS ANTOINE's avatar BEAUVAIS ANTOINE
Browse files

Updated Javadoc.

parent b1a7f835
Branches
1 merge request!8Merge 'develop' into 'master'.
gradlew 100644 → 100755
File mode changed from 100644 to 100755
......@@ -25,7 +25,7 @@ public class DatabaseSystem {
* to the desired one.
*
* @return the instance of the database implementation.
* @throws fr.unistra.sil.erp.back.db.DatabaseConnectionException
* @throws DatabaseConnectionException if the connection to the DB failed.
*/
public static DatabaseInterface getInstance() throws DatabaseConnectionException
{
......
......@@ -15,9 +15,9 @@ public interface IRetrieveInfoController {
/**
* Retrieves the list of items.
* @param cat
* @return
* @throws Exception
* @param cat the optional category to filter.
* @return the list of items as a JSON response/
* @throws Exception if the request cannot be served.
*/
public ResponseEntity<Object> retrieveInfo(
@RequestParam(value = "category", defaultValue = "") String cat
......
......@@ -30,8 +30,8 @@ public class ApiRetrieveItemsController implements IRetrieveInfoController {
* Returns all products as a JSON response.
* @param cat an optional category.
* @return a JSON response.
* @throws fr.unistra.sil.erp.back.controller.api.ApiServerErrorException
* @throws fr.unistra.sil.erp.back.controller.api.ApiBadRequestException
* @throws ApiServerErrorException if the request could not be served.
* @throws ApiBadRequestException if the category parameter is invalid.
*/
@GetMapping(MAPPING_RETRIEVEALL)
public ResponseEntity<Object> retrieveInfo(
......
......@@ -32,7 +32,7 @@ public class ApiRetrieveStocks implements IRetrieveStocks {
* @param request the HTTP request.
* @param response the HTTP response.
* @return the response.
* @throws fr.unistra.sil.erp.back.controller.api.ApiServerErrorException
* @throws ApiServerErrorException if the request could not be served.
*/
@GetMapping(MAPPING_GETSTOCKS)
@Override
......
......@@ -48,7 +48,7 @@ public interface DatabaseInterface {
/**
* Returns the stock entry of an item.
* @param id the item's ID.
* @param itemId the item's ID.
* @return the stock line.
* @throws DatabaseResourceNotFoundException when the query fails.
*/
......@@ -59,6 +59,7 @@ public interface DatabaseInterface {
* Updates the specified stock's quantity.
* @param id the stock entry's ID.
* @param quantity the new quantity.
* @throws DatabaseConnectionException when the database is unreachable.
* @throws DatabaseUpdateException when the query fails.
*/
public void updateStock(int id, int quantity)
......
......@@ -28,11 +28,22 @@ public class ApiAuthenticationInterceptor implements HandlerInterceptor {
*/
private final String apikey;
/**
* Class constructor.
* @param apikey the API key.
*/
public ApiAuthenticationInterceptor(String apikey)
{
this.apikey = apikey;
}
/**
* Code used to check the request's API key against the real one.
* @param request the HTTP Servlet request.
* @param response the HTTP Servlet response.
* @param handler the handler Object.
* @return whether the request should be continued.
*/
@Override
public boolean preHandle(HttpServletRequest request,
HttpServletResponse response, Object handler)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment