ConsomationController.java 1.92 KB

package etunicorn.generated;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;


/**
 * No description
 * (Generated with springmvc-raml-parser v.0.8.9)
 */
@RestController
@RequestMapping("/v1/consomation")
public interface ConsomationController {


    /**
     * Obtenir la liste de toutes les consomations. Nécessite CONSO_ADMIN ou CONSO_ACHETER ou CONSO_REMBOURSER
     */
    @RequestMapping(value = "", method = RequestMethod.GET)
    public ResponseEntity<?> getConsomation();

    /**
     * Permet de creer une nouvelle consomation. Nécessite CONSO_ADMIN
     */
    @RequestMapping(value = "", method = RequestMethod.POST)
    public ResponseEntity<?> updateConsomation(
            @RequestParam
                    String nomConsomation,
            @RequestParam
                    BigDecimal prix);

    /**
     * Permet de modifier une consommation. Nécessite CONSO_ADMIN
     */
    @RequestMapping(value = "/{consomationId}", method = RequestMethod.PUT)
    public ResponseEntity<?> updateConsomationById(
            @PathVariable
                    String consomationId,
            @RequestParam(required = false)
                    String nomEvenement,
            @RequestParam(required = false)
                    BigDecimal prix);

    /**
     * Obtenir la Consomation {consomationId}. Nécessite CONSO_ADMIN ou CONSO_ACHETER ou CONSO_REMBOURSER
     */
    @RequestMapping(value = "/{consomationId}", method = RequestMethod.GET)
    public ResponseEntity<?> getConsomationById(
            @PathVariable
                    String consomationId);

    /**
     * Permet de supprimer la consomation {consomationId}. Nécessite CONSO_ADMIN
     */
    @RequestMapping(value = "/{consomationId}", method = RequestMethod.DELETE)
    public ResponseEntity<?> deleteConsomationById(
            @PathVariable
                    String consomationId);

}