Пример #1
1
 /**
  * 保存内容管理
  *
  * @param content
  * @return
  */
 @RequestMapping(method = RequestMethod.POST)
 public ResponseEntity<Void> saveContent(Content content) {
   try {
     contentService.save(content);
     return ResponseEntity.status(HttpStatus.CREATED).build();
   } catch (Exception e) {
     e.printStackTrace();
     return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
   }
 }
Пример #2
0
  /**
   * 修改
   *
   * @param content
   * @return
   */
  @RequestMapping(value = "edit", method = RequestMethod.POST)
  public ResponseEntity<Void> updateContentByContentId(Content content) {

    try {
      contentService.updateByPrimaryKeySelective(content);
      return ResponseEntity.status(HttpStatus.CREATED).build();
    } catch (Exception e) {
      e.printStackTrace();
      return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
    }
  }