Search in sources :

Example 1 with JournalInputView

use of org.ambraproject.rhino.view.journal.JournalInputView in project rhino by PLOS.

the class JournalCrudController method update.

@Transactional(rollbackFor = { Throwable.class })
@RequestMapping(value = "/journals/{journalKey}", method = RequestMethod.PATCH)
@ApiImplicitParam(name = "body", paramType = "body", dataType = "JournalInputView", value = "example: {\"currentIssueDoi\": \"10.1371/issue.pmed.v13.i09\"}")
public ResponseEntity<?> update(@RequestHeader(value = HttpHeaders.IF_MODIFIED_SINCE, required = false) Date ifModifiedSince, HttpServletRequest request, @PathVariable String journalKey) throws IOException {
    JournalInputView input = readJsonFromRequest(request, JournalInputView.class);
    journalCrudService.update(journalKey, input);
    return journalCrudService.serve(journalKey).getIfModified(ifModifiedSince).asJsonResponse(entityGson);
}
Also used : JournalInputView(org.ambraproject.rhino.view.journal.JournalInputView) ApiImplicitParam(com.wordnik.swagger.annotations.ApiImplicitParam) Transactional(org.springframework.transaction.annotation.Transactional) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ApiImplicitParam (com.wordnik.swagger.annotations.ApiImplicitParam)1 JournalInputView (org.ambraproject.rhino.view.journal.JournalInputView)1 Transactional (org.springframework.transaction.annotation.Transactional)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1