コード例 #1
0
 @RequestMapping(consumes = "application/json", method = RequestMethod.PUT)
 @Override
 public HttpEntity<ResponseBean> update(@RequestBody Question entity)
     throws SpartanPersistenceException, SpartanTransactionException, Exception {
   ResponseBean responseBean = new ResponseBean();
   org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.OK;
   try {
     questionrepo.update(entity);
     responseBean.add("success", true);
     responseBean.add("message", "Successfully updated ");
     responseBean.add("data", entity._getPrimarykey().toString());
   } catch (org.springframework.transaction.TransactionException e) {
     throw new com.athena.framework.server.exception.repository.SpartanTransactionException(
         "can not update", e.getRootCause());
   }
   return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus);
 }
コード例 #2
0
 @RequestMapping(
     consumes = "application/json",
     headers = {"isArray"},
     method = RequestMethod.PUT)
 @Override
 public HttpEntity<ResponseBean> update(
     @RequestBody List<Question> entity, @RequestHeader("isArray") boolean request)
     throws SpartanPersistenceException, SpartanTransactionException, Exception {
   ResponseBean responseBean = new ResponseBean();
   org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.OK;
   try {
     questionrepo.update(entity);
     responseBean.add("success", true);
     responseBean.add("message", "Successfully updated entities");
     httpStatus = org.springframework.http.HttpStatus.OK;
   } catch (org.springframework.transaction.TransactionException e) {
     throw new com.athena.framework.server.exception.repository.SpartanTransactionException(
         "can not update", e.getRootCause());
   }
   return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus);
 }