org.springframework.web.bind.annotation.RequestMethod#DELETE源码实例Demo

下面列出了org.springframework.web.bind.annotation.RequestMethod#DELETE 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: activiti6-boot2   文件: TaskCommentResource.java
@ApiOperation(value = "Delete a comment on a task", tags = {"Tasks"}, nickname = "deleteTaskComment")
@ApiResponses(value = {
    @ApiResponse(code = 204, message = "Indicates the task and comment were found and the comment is deleted. Response body is left empty intentionally."),
    @ApiResponse(code = 404, message = "Indicates the requested task was not found or the tasks doesn’t have a comment with the given ID.")
})
@RequestMapping(value = "/runtime/tasks/{taskId}/comments/{commentId}", method = RequestMethod.DELETE)
public void deleteComment(@ApiParam(name = "taskId", value="The id of the task to delete the comment for.") @PathVariable("taskId") String taskId,@ApiParam(name = "commentId", value="The id of the comment.") @PathVariable("commentId") String commentId, HttpServletResponse response) {

  // Check if task exists
  Task task = getTaskFromRequest(taskId);

  Comment comment = taskService.getComment(commentId);
  if (comment == null || comment.getTaskId() == null || !comment.getTaskId().equals(task.getId())) {
    throw new ActivitiObjectNotFoundException("Task '" + task.getId() + "' doesn't have a comment with id '" + commentId + "'.", Comment.class);
  }

  taskService.deleteComment(commentId);
  response.setStatus(HttpStatus.NO_CONTENT.value());
}
 
源代码2 项目: jeecg-cloud   文件: SysDictItemController.java
/**
 * @功能:删除字典数据
 * @param id
 * @return
 */
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result<SysDictItem> delete(@RequestParam(name="id",required=true) String id) {
	Result<SysDictItem> result = new Result<SysDictItem>();
	SysDictItem joinSystem = sysDictItemService.getById(id);
	if(joinSystem==null) {
		result.error500("未找到对应实体");
	}else {
		boolean ok = sysDictItemService.removeById(id);
		if(ok) {
			result.success("删除成功!");
		}
	}
	return result;
}
 
源代码3 项目: herd   文件: BusinessObjectDataRestController.java
/**
 * Deletes an existing business object data with 1 subpartition value with namespace. <p> Requires WRITE permission on namespace </p>
 *
 * @param namespace the namespace.
 * @param businessObjectDefinitionName the business object definition name
 * @param businessObjectFormatUsage the business object format usage
 * @param businessObjectFormatFileType the business object format file type
 * @param businessObjectFormatVersion the business object format version
 * @param partitionValue the partition value
 * @param subPartition1Value sub-partition value 1
 * @param businessObjectDataVersion the business object data version
 * @param deleteFiles whether files should be deleted
 *
 * @return the deleted business object data information
 */
@RequestMapping(
    value = "/businessObjectData/namespaces/{namespace}" +
        "/businessObjectDefinitionNames/{businessObjectDefinitionName}/businessObjectFormatUsages/{businessObjectFormatUsage}" +
        "/businessObjectFormatFileTypes/{businessObjectFormatFileType}/businessObjectFormatVersions/{businessObjectFormatVersion}" +
        "/partitionValues/{partitionValue}/subPartition1Values/{subPartition1Value}/businessObjectDataVersions/{businessObjectDataVersion}",
    method = RequestMethod.DELETE)
@Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DATA_DELETE)
public BusinessObjectData deleteBusinessObjectData(@PathVariable("namespace") String namespace,
    @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
    @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,
    @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType,
    @PathVariable("businessObjectFormatVersion") Integer businessObjectFormatVersion, @PathVariable("partitionValue") String partitionValue,
    @PathVariable("subPartition1Value") String subPartition1Value, @PathVariable("businessObjectDataVersion") Integer businessObjectDataVersion,
    @RequestParam("deleteFiles") Boolean deleteFiles)
{
    return businessObjectDataService.deleteBusinessObjectData(
        new BusinessObjectDataKey(namespace, businessObjectDefinitionName, businessObjectFormatUsage, businessObjectFormatFileType,
            businessObjectFormatVersion, partitionValue, Arrays.asList(subPartition1Value), businessObjectDataVersion), deleteFiles);
}
 
源代码4 项目: JDeSurvey   文件: AuthorityController.java
@Secured({"ROLE_ADMIN"})
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE, produces = "text/html")
public String delete(@PathVariable("id") Long id, 
					Principal principal,			 
					Model uiModel,
					HttpServletRequest httpServletRequest) {
	log.info("delete(): id=" + id);
	try {
		SecurityObject authority = userService.authority_findById(id);
		userService.authority_remove(authority);
		uiModel.asMap().clear();
		return "redirect:/security/authorities/" ;
	} catch (Exception e) {
		log.error(e.getMessage(),e);
		throw (new RuntimeException(e));
	}
}
 
源代码5 项目: flash-waimai   文件: LoginLogController.java
/**
 * 清空日志
 */
@RequestMapping(method = RequestMethod.DELETE)
@RequiresPermissions(value = {Permission.LOGIN_LOG_CLEAR})
public Object clear() {
    loginlogService.clear();
    return Rets.success();
}
 
源代码6 项目: metacat   文件: TagController.java
/**
 * Remove the tags from the given resource.
 *
 * @param tagRemoveRequestDto remove tag request dto
 */
@RequestMapping(
    method = RequestMethod.DELETE,
    consumes = MediaType.APPLICATION_JSON_VALUE
)
@ResponseStatus(HttpStatus.NO_CONTENT)
@ApiOperation(
    value = "Remove the tags from the given resource",
    notes = "Remove the tags from the given resource"
)
@ApiResponses(
    {
        @ApiResponse(
            code = HttpURLConnection.HTTP_NO_CONTENT,
            message = "The tags were successfully deleted from the table"
        ),
        @ApiResponse(
            code = HttpURLConnection.HTTP_NOT_FOUND,
            message = "The requested catalog or database or table cannot be located"
        )
    }
)
public void removeTags(
    @ApiParam(value = "Request containing the set of tags and qualifiedName", required = true)
    @RequestBody final TagRemoveRequestDto tagRemoveRequestDto
) {


    this.requestWrapper.processRequest(
        tagRemoveRequestDto.getName(),
        "TagV1Resource.removeTableTags",
        () -> {
            this.removeResourceTags(tagRemoveRequestDto);
            return null;
        }
    );
}
 
源代码7 项目: logistics-back   文件: DriverInfoController.java
@ApiOperation(value = "删除一个司机信息", notes = "通过 id 删除司机信息")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.DELETE)
public String delete(@PathVariable("id") String id) {
	boolean flag = false;
	flag = driverInfoService.deleteById(id);
	if (!flag) {
		return ERROR;
	}
	return SUCCESS;
}
 
源代码8 项目: NFVO   文件: RestProject.java
/**
 * Removes the Project from the Projects repository
 *
 * @param id : the id of project to be removed
 */
@ApiOperation(
    value = "Remove a Project",
    notes = "Specify the id of the project that will be deleted in the URL")
@RequestMapping(value = "{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void delete(@PathVariable("id") String id)
    throws NotAllowedException, NotFoundException, EntityInUseException, BadRequestException {
  log.info("Removing Project with id " + id);
  if (utils.isAdmin()) {
    projectManagement.delete(projectManagement.query(id));
  } else {
    throw new NotAllowedException("Forbidden to delete project " + id);
  }
}
 
源代码9 项目: database-rider   文件: UserController.java
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
@ResponseBody
public String delete(long id) {
    try {
        User user = new User(id);
        userRepository.delete(user);
    } catch (Exception ex) {
        return "Error deleting the user: " + ex.toString();
    }
    return "User succesfully deleted!";
}
 
源代码10 项目: NFVO   文件: RestNetworkServiceRecord.java
@ApiOperation(
    value = "Remove a VNF Dependency from a NSR",
    notes = "Removes a VNF Dependency based on a VNFR it concerns")
@RequestMapping(value = "{idNsr}/vnfdependencies/{idVnfd}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void deleteVNFDependency(
    @PathVariable("idNsr") String idNsr,
    @PathVariable("idVnfd") String idVnfd,
    @RequestHeader(value = "project-id") String projectId)
    throws NotFoundException {
  networkServiceRecordManagement.deleteVNFDependency(idNsr, idVnfd, projectId);
}
 
源代码11 项目: restfiddle   文件: ModuleController.java
@RequestMapping(value = "/api/modules/{id}", method = RequestMethod.DELETE, headers = "Accept=application/json")
   public @ResponseBody
   Module delete(@PathVariable("id") String id) {
logger.debug("Deleting module with id: " + id);

Module deleted = moduleRepository.findOne(id);

moduleRepository.delete(deleted);

return deleted;
   }
 
源代码12 项目: iotplatform   文件: CustomerController.java
@PreAuthorize("hasAuthority('TENANT_ADMIN')")
@RequestMapping(value = "/customer/{customerId}", method = RequestMethod.DELETE)
@ResponseStatus(value = HttpStatus.OK)
public void deleteCustomer(@PathVariable("customerId") String strCustomerId) throws IoTPException {
    checkParameter("customerId", strCustomerId);
    try {
        CustomerId customerId = new CustomerId(toUUID(strCustomerId));
        checkCustomerId(customerId);
        customerService.deleteCustomer(customerId);
    } catch (Exception e) {
        throw handleException(e);
    }
}
 
源代码13 项目: web-flash   文件: ChannelMgrController.java
@RequestMapping(method = RequestMethod.DELETE)
@BussinessLog(value = "删除栏目", key = "id")
@RequiresPermissions(value = {Permission.CHANNEL_DEL})
public Object remove(Long id) {
    channelService.delete(id);
    return Rets.success();
}
 
@Deprecated
   @RequestMapping(value = "/subscription", method = RequestMethod.DELETE)
   public ResponseEntity<String> deleteSubscription(@RequestBody SimpleSubscription subscription) {
	return deleteSubscription(subscription.getSubscription());
}
 
@RequestMapping(method = RequestMethod.DELETE, value = "{id}")
public void delete(@PathVariable String id) {
    repo.remove(repo.get(id));
}
 
源代码16 项目: NFVO   文件: RestEvent.java
/**
 * Removes the EventEndpoint from the EventEndpoint repository
 *
 * @param id : The Event's id to be deleted
 */
@RequestMapping(value = "{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
public void unregister(@PathVariable("id") String id) throws NotFoundException {
  eventDispatcher.unregister(id);
}
 
源代码17 项目: boubei-tss   文件: PortalAction.java
/**
 * 删除门户结构
 */
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public void delete(HttpServletResponse response, @PathVariable("id") Long id) {
    service.deleteStructure(id);
    printSuccessMessage();
}
 
源代码18 项目: microservice-atom   文件: OrderController.java
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public ModelAndView post(@PathVariable("id") long id) {
	orderRepository.deleteById(id);

	return new ModelAndView("success");
}
 
源代码19 项目: microservice   文件: OrderController.java
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public ModelAndView post(@PathVariable("id") long id) {
	orderRepository.deleteById(id);

	return new ModelAndView("success");
}
 
源代码20 项目: boubei-tss   文件: SubAuthorizeAction.java
/**
 * 删除策略
 */
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public void delete(HttpServletResponse response, @PathVariable("id") Long id) {
	service.deleteSubauth(id);
       printSuccessMessage();
}