Search in sources :

Example 1 with QcTypeDto

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

the class QcTypeRestController method updateSubproject.

@PutMapping(value = "/{id}", headers = { "Content-type=application/json" })
@ResponseBody
public QcTypeDto updateSubproject(@PathVariable("id") long id, @RequestBody QcTypeDto qcTypeDto) throws IOException {
    return RestUtils.updateObject("QC Type", id, qcTypeDto, Dtos::to, qcTypeService, qcType -> {
        QcTypeDto dto = Dtos.asDto(qcType);
        constantsController.refreshConstants();
        return dto;
    });
}
Also used : Dtos(uk.ac.bbsrc.tgac.miso.dto.Dtos) QcTypeDto(uk.ac.bbsrc.tgac.miso.dto.QcTypeDto) PutMapping(org.springframework.web.bind.annotation.PutMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 2 with QcTypeDto

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

the class QcTypeRestController method createQcType.

@PostMapping(headers = { "Content-type=application/json" })
@ResponseBody
public QcTypeDto createQcType(@RequestBody QcTypeDto qcTypeDto) throws IOException {
    return RestUtils.createObject("QC Type", qcTypeDto, Dtos::to, qcTypeService, qcType -> {
        QcTypeDto dto = Dtos.asDto(qcType);
        constantsController.refreshConstants();
        return dto;
    });
}
Also used : Dtos(uk.ac.bbsrc.tgac.miso.dto.Dtos) QcTypeDto(uk.ac.bbsrc.tgac.miso.dto.QcTypeDto) PostMapping(org.springframework.web.bind.annotation.PostMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 3 with QcTypeDto

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

the class QcTypeController method setupForm.

private ModelAndView setupForm(QcType qcType, ModelMap model) throws JsonProcessingException {
    QcTypeDto dto = Dtos.asDto(qcType);
    ObjectMapper mapper = new ObjectMapper();
    model.put("qcTypeDto", mapper.writeValueAsString(dto));
    return new ModelAndView("/WEB-INF/pages/editQcType.jsp", model);
}
Also used : ModelAndView(org.springframework.web.servlet.ModelAndView) QcTypeDto(uk.ac.bbsrc.tgac.miso.dto.QcTypeDto) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

QcTypeDto (uk.ac.bbsrc.tgac.miso.dto.QcTypeDto)3 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)2 Dtos (uk.ac.bbsrc.tgac.miso.dto.Dtos)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 PostMapping (org.springframework.web.bind.annotation.PostMapping)1 PutMapping (org.springframework.web.bind.annotation.PutMapping)1 ModelAndView (org.springframework.web.servlet.ModelAndView)1