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

Added stub API POST mapping for transaction submission.

Also added some documentation for the RetrieveCategories mapping.
parent 8c48085b
Branches
No related merge requests found
......@@ -17,6 +17,8 @@ dependencies {
implementation 'org.xerial:sqlite-jdbc:3.36.0.3'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.7'
implementation 'org.springframework.boot:spring-boot-starter-web'
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
......
......@@ -19,4 +19,7 @@ public class Config {
public static final String MAPPING_GETCATEGORIES = URL_PREFIX +
"/retrieveCategories";
public static final String MAPPING_SUBTRANSAC = URL_PREFIX +
"/submitTransaction";
}
......@@ -24,6 +24,11 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
public class ApiRetrieveCategoriesController {
/**
* Returns the list of categories in JSON format.
* @return the HTTP response.
* @throws ApiServerErrorException Database failure.
*/
@GetMapping(MAPPING_GETCATEGORIES)
public ResponseEntity<Object> getCategories() throws ApiServerErrorException
{
......
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package fr.unistra.sil.erp.back.api.controller;
import static fr.unistra.sil.erp.back.Config.MAPPING_SUBTRANSAC;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* REST Controller for submitting transactions.
* @author BEAUVAIS ANTOINE
*/
@RestController
public class ApiSubmitTransactionController {
@RequestMapping(value=MAPPING_SUBTRANSAC, method = RequestMethod.POST)
public ResponseEntity<Object> submitTransaction(HttpServletRequest request,
HttpServletResponse response)
{
throw new UnsupportedOperationException("Not yet supported.");
}
}
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