コード例 #1
0
 @RequestMapping(value = "/findAll", consumes = "application/json", method = RequestMethod.GET)
 @Override
 public HttpEntity<ResponseBean> findAll() throws SpartanPersistenceException, Exception {
   ResponseBean responseBean = new ResponseBean();
   org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.OK;
   java.util.List<klickakartk.app.shared.contacts.CommunicationGroup> lstcommunicationgroup =
       communicationGrouprepo.findAll();
   responseBean.add("success", true);
   responseBean.add("message", "Successfully retrived ");
   responseBean.add("data", lstcommunicationgroup);
   return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus);
 }
コード例 #2
0
 @RequestMapping(value = "/findById", method = RequestMethod.POST)
 @Override
 public HttpEntity<ResponseBean> findById(@RequestBody FindByBean findByBean)
     throws SpartanPersistenceException, Exception {
   com.athena.framework.server.bean.ResponseBean responseBean = new ResponseBean();
   org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.OK;
   klickakartk.app.shared.contacts.CommunicationGroup lstcommunicationgroup =
       communicationGrouprepo.findById((String) findByBean.getFindKey());
   responseBean.add("success", true);
   responseBean.add("message", "Successfully retrived ");
   responseBean.add("data", lstcommunicationgroup);
   return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus);
 }
コード例 #3
0
 @RequestMapping(value = "/search", consumes = "application/json", method = RequestMethod.POST)
 @Override
 public HttpEntity<ResponseBean> search(@RequestBody Map<String, Object> fieldData)
     throws SpartanPersistenceException, Exception {
   ResponseBean responseBean = new ResponseBean();
   org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.OK;
   List<java.lang.Object> lstcommunicationgroup =
       communicationGrouprepo.search(
           "CommunicationGroup.DefaultFinders", fieldData, getFieldMetaData());
   responseBean.add("success", true);
   responseBean.add("message", "Successfully retrived ");
   responseBean.add("data", lstcommunicationgroup);
   return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus);
 }
コード例 #4
0
 @RequestMapping(value = "/{cid}", consumes = "application/json", method = RequestMethod.DELETE)
 @Override
 public HttpEntity<ResponseBean> delete(@PathVariable("cid") String entity)
     throws SpartanPersistenceException, Exception {
   ResponseBean responseBean = new ResponseBean();
   org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.OK;
   try {
     communicationGrouprepo.delete(entity);
     httpStatus = org.springframework.http.HttpStatus.NO_CONTENT;
   } catch (org.springframework.transaction.TransactionException e) {
     throw new com.athena.framework.server.exception.repository.SpartanTransactionException(
         "can not delete", e.getCause());
   }
   return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus);
 }
コード例 #5
0
 @RequestMapping(consumes = "application/json", method = RequestMethod.PUT)
 @Override
 public HttpEntity<ResponseBean> update(@RequestBody CommunicationGroup entity)
     throws SpartanPersistenceException, Exception {
   ResponseBean responseBean = new ResponseBean();
   org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.OK;
   try {
     communicationGrouprepo.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.getCause());
   }
   return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus);
 }
コード例 #6
0
 @RequestMapping(
     consumes = "application/json",
     headers = {"isArray"},
     method = RequestMethod.POST)
 @Override
 public HttpEntity<ResponseBean> save(
     @RequestBody List<CommunicationGroup> entity, @RequestHeader("isArray") boolean request)
     throws SpartanPersistenceException, Exception {
   ResponseBean responseBean = new ResponseBean();
   org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.CREATED;
   try {
     communicationGrouprepo.save(entity);
     responseBean.add("success", true);
     responseBean.add("message", "Successfully Created");
     httpStatus = org.springframework.http.HttpStatus.CREATED;
   } catch (org.springframework.transaction.TransactionException e) {
     throw new com.athena.framework.server.exception.repository.SpartanTransactionException(
         "can not save", e.getCause());
   }
   return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus);
 }