Search in sources :

Example 1 with LabDto

use of uk.ac.bbsrc.tgac.miso.dto.LabDto in project miso-lims by miso-lims.

the class LabRestController method createLab.

@PostMapping(headers = { "Content-type=application/json" })
@ResponseBody
public LabDto createLab(@RequestBody LabDto labDto, UriComponentsBuilder uriBuilder) throws IOException {
    LabDto saved = RestUtils.createObject("Lab", labDto, Dtos::to, labService, Dtos::asDto);
    constantsController.refreshConstants();
    return saved;
}
Also used : Dtos(uk.ac.bbsrc.tgac.miso.dto.Dtos) LabDto(uk.ac.bbsrc.tgac.miso.dto.LabDto) PostMapping(org.springframework.web.bind.annotation.PostMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 2 with LabDto

use of uk.ac.bbsrc.tgac.miso.dto.LabDto in project miso-lims by miso-lims.

the class LabRestController method updateLab.

@PutMapping(value = "/{id}", headers = { "Content-type=application/json" })
@ResponseBody
public LabDto updateLab(@PathVariable("id") Long id, @RequestBody LabDto labDto, UriComponentsBuilder uriBuilder) throws IOException {
    LabDto updated = RestUtils.updateObject("Lab", id, labDto, Dtos::to, labService, Dtos::asDto);
    constantsController.refreshConstants();
    return updated;
}
Also used : Dtos(uk.ac.bbsrc.tgac.miso.dto.Dtos) LabDto(uk.ac.bbsrc.tgac.miso.dto.LabDto) PutMapping(org.springframework.web.bind.annotation.PutMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

ResponseBody (org.springframework.web.bind.annotation.ResponseBody)2 Dtos (uk.ac.bbsrc.tgac.miso.dto.Dtos)2 LabDto (uk.ac.bbsrc.tgac.miso.dto.LabDto)2 PostMapping (org.springframework.web.bind.annotation.PostMapping)1 PutMapping (org.springframework.web.bind.annotation.PutMapping)1