Пример #1
0
 /** POST /outMessages -> Create a new outMessage. */
 @RequestMapping(
     value = "/outMessages",
     method = RequestMethod.POST,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public ResponseEntity<Void> create(@Valid @RequestBody OutMessage outMessage)
     throws URISyntaxException {
   log.debug("REST request to save OutMessage : {}", outMessage);
   if (outMessage.getId() != null) {
     return ResponseEntity.badRequest()
         .header("Failure", "A new outMessage cannot already have an ID")
         .build();
   }
   outMessageRepository.save(outMessage);
   return ResponseEntity.created(new URI("/api/outMessages/" + outMessage.getId())).build();
 }
Пример #2
0
 /** PUT /outMessages -> Updates an existing outMessage. */
 @RequestMapping(
     value = "/outMessages",
     method = RequestMethod.PUT,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public ResponseEntity<Void> update(@Valid @RequestBody OutMessage outMessage)
     throws URISyntaxException {
   log.debug("REST request to update OutMessage : {}", outMessage);
   if (outMessage.getId() == null) {
     return create(outMessage);
   }
   outMessageRepository.save(outMessage);
   //		try {
   //			activityService.updateMenu();
   //		} catch (UnsupportedEncodingException e) {
   //			log.debug("更新菜单出错");
   //			e.printStackTrace();
   //		}
   return ResponseEntity.ok().build();
 }