tools.dynamia.app.controllers.CrudServiceRestController Maven / Gradle / Ivy
The newest version!
package tools.dynamia.app.controllers;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import tools.dynamia.commons.StringPojoParser;
import tools.dynamia.domain.ValidationError;
import tools.dynamia.domain.query.QueryParameters;
import tools.dynamia.domain.services.CrudService;
import java.io.Serializable;
import java.util.List;
@RestController
@RequestMapping(value = "/crud-service/{className}", consumes = "application/json", produces = "application/json")
public class CrudServiceRestController {
private final CrudService crudService;
private final ObjectMapper mapper = StringPojoParser.createJsonMapper();
public CrudServiceRestController(CrudService crudService) {
this.crudService = crudService;
}
@RequestMapping(method = {RequestMethod.POST, RequestMethod.PUT})
public ResponseEntity