Search in sources :

Example 6 with FormModel

use of com.plumdo.form.entity.FormModel in project plumdo-work by wengwh.

the class FormModelEditorResource method saveEditorJson.

@ApiOperation(value = "保存表单模型设计内容", notes = "根据传入的editorJson来保存表单模型设计内容")
@ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "表单模型ID", required = true, dataType = "Long", paramType = "path"), @ApiImplicitParam(name = "editorJson", value = "表单模型设计内容", required = true, dataType = "String") })
@RequestMapping(value = "/form-models/{id}/json", method = RequestMethod.PUT)
@ResponseStatus(value = HttpStatus.OK)
public FormModelResponse saveEditorJson(@PathVariable Long id, @RequestBody String editorJson) throws UnsupportedEncodingException {
    FormModel formModel = getFormModelFromRequest(id);
    formModel.setEditorSourceBytes(editorJson.getBytes("utf-8"));
    formModelRepository.save(formModel);
    return responseFactory.createFormModelResponse(formModel);
}
Also used : FormModel(com.plumdo.form.entity.FormModel) ApiImplicitParams(io.swagger.annotations.ApiImplicitParams) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) ApiOperation(io.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

FormModel (com.plumdo.form.entity.FormModel)6 ApiOperation (io.swagger.annotations.ApiOperation)6 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)6 ResponseStatus (org.springframework.web.bind.annotation.ResponseStatus)6 ApiImplicitParam (io.swagger.annotations.ApiImplicitParam)4 ApiImplicitParams (io.swagger.annotations.ApiImplicitParams)2 FormDefinition (com.plumdo.form.entity.FormDefinition)1 Transactional (org.springframework.transaction.annotation.Transactional)1