当前位置: 首页>>代码示例>>Java>>正文


Java RequestMethod.DELETE属性代码示例

本文整理汇总了Java中org.springframework.web.bind.annotation.RequestMethod.DELETE属性的典型用法代码示例。如果您正苦于以下问题:Java RequestMethod.DELETE属性的具体用法?Java RequestMethod.DELETE怎么用?Java RequestMethod.DELETE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.springframework.web.bind.annotation.RequestMethod的用法示例。


在下文中一共展示了RequestMethod.DELETE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deleteResources

/**
 * Delete resources (files and folders) into a container for a path
 *
 * @param containerId
 * @param applicationName
 * @param path
 * @return
 * @throws ServiceException
 * @throws CheckException
 * @throws IOException
 */
@RequestMapping(value = "/container/{containerId}/application/{applicationName}", method = RequestMethod.DELETE)
@ResponseBody
public JsonResponse deleteResources(@PathVariable final String containerId,
		@PathVariable final String applicationName, @RequestParam("path") String path)
		throws ServiceException, CheckException, IOException {

	if (logger.isDebugEnabled()) {
		logger.debug("containerId:" + containerId);
		logger.debug("applicationName:" + applicationName);
		logger.debug("path:" + path);
	}

	fileService.deleteFilesFromContainer(applicationName, containerId, path);

	return new HttpOk();
}
 
开发者ID:oncecloud,项目名称:devops-cstack,代码行数:27,代码来源:FileController.java

示例2: delete

/**
 * Delete the reading from persistent storage. NotFoundException (HTTP 404) if the reading cannot
 * be found by id. ServiceException (HTTP 503) for unknown or unanticipated issues.
 * 
 * @param id - database generated id of the reading to be deleted
 * @return boolean indicating success of the delete operation
 * @throws ServiceException (HTTP 503) for unknown or unanticipated issues
 * @throws NotFoundException (HTTP 404) if the reading cannot be located by the provided id in the
 *         reading.
 */
@RequestMapping(value = "/id/{id}", method = RequestMethod.DELETE)
@Override
public boolean delete(@PathVariable String id) {
  try {
    Reading reading = readingRepos.findOne(id);
    if (reading != null) {
      readingRepos.delete(reading);
      return true;
    } else {
      logger.error("Request to delete with non-existent reading:  " + id);
      throw new NotFoundException(Reading.class.toString(), id);
    }
  } catch (NotFoundException nE) {
    throw nE;
  } catch (Exception e) {
    logger.error("Error removing reading:  " + e.getMessage());
    throw new ServiceException(e);
  }
}
 
开发者ID:edgexfoundry,项目名称:core-data,代码行数:29,代码来源:ReadingControllerImpl.java

示例3: deleteUser

@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
@RequestMapping(value = "/user/{userId}", method = RequestMethod.DELETE)
@ResponseStatus(value = HttpStatus.OK)
public void deleteUser(@PathVariable("userId") String strUserId) throws IoTPException {
    checkParameter("userId", strUserId);
    try {
        UserId userId = new UserId(toUUID(strUserId));
        checkUserId(userId);
        userService.deleteUser(userId);
    } catch (Exception e) {
        throw handleException(e);
    }
}
 
开发者ID:osswangxining,项目名称:iotplatform,代码行数:13,代码来源:UserController.java

示例4: deleteCustomer

@SuppressWarnings({ "unchecked", "rawtypes" })
@RequestMapping(value = "/customer/{customerId}", method = RequestMethod.DELETE)
public ResponseEntity<?> deleteCustomer(@PathVariable("customerId") long customerId) {
	logger.info("Fetching & Deleting customer with id {}", customerId);

	Customer customer = customerService.findById(customerId);
	if (customer == null) {
		logger.error("Unable to delete. User with customer {} not found.", customerId);
		return new ResponseEntity(new CustomErrorType("Unable to delete. Customer with id " + customerId + " not found."),
				HttpStatus.NOT_FOUND);
	}
	customerService.deleteCustomerById(customerId);
	return new ResponseEntity<Customer>(HttpStatus.NO_CONTENT);
}
 
开发者ID:dockersamples,项目名称:atsea-sample-shop-app,代码行数:14,代码来源:CustomerController.java

示例5: abortMultipartUpload

/**
 * Aborts a multipart upload for a given uploadId.
 *
 * http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadAbort.html
 *
 * @param bucketName the Bucket in which to store the file in.
 * @param uploadId id of the upload. Has to match all other part's uploads.
 */
@RequestMapping(
    value = "/{bucketName:.+}/**",
    params = {"uploadId"},
    method = RequestMethod.DELETE,
    produces = "application/x-www-form-urlencoded")
public void abortMultipartUpload(@PathVariable final String bucketName,
    @RequestParam(required = true) final String uploadId,
    final HttpServletRequest request) {
  final String filename = filenameFrom(bucketName, request);
  fileStore.abortMultipartUpload(bucketName, filename, uploadId);
}
 
开发者ID:adobe,项目名称:S3Mock,代码行数:19,代码来源:FileStoreController.java

示例6: releaseActions

/**
 * Implements the "Release Actions" command See
 * https://www.w3.org/TR/webdriver/#dfn-release-actions
 */
@RequestMapping(value = "/session/{sessionId}/actions", method = RequestMethod.DELETE, produces = "application/json; charset=utf-8")
public @ResponseBody ResponseEntity<Response> releaseActions(@PathVariable String sessionId,
		@RequestBody(required = false) String body) throws Throwable {
	LOGGER.info("releaseActions -->");
	LOGGER.info("  -> " + body);

	// TODO: Implement me!

	LOGGER.info("releaseActions <--");

	return responseFactory.success(sessionId);
}
 
开发者ID:MicroFocus,项目名称:SilkAppDriver,代码行数:16,代码来源:W3CProtocolController.java

示例7: delete

/**
 * 进入到消息添加页面
 * @param messageId 消息id
 * @return
 */
@ResponseBody
@RequestMapping(value={"/delete/{messageId}"},method= RequestMethod.DELETE)
public ResponseEntity delete(@PathVariable int messageId){
    messageService.deleteSysMessageById(messageId);
    return new ResponseEntity(200,"消息删除成功","");
}
 
开发者ID:babymm,项目名称:mumu,代码行数:11,代码来源:SysMessageController.java

示例8: delete

@RequestMapping(value ="{id}", method = RequestMethod.DELETE)
public ResponseEntity<Map<String, Object>> delete(@PathVariable("id") @Valid String slackId) {
  ResponseEntity<Map<String, Object>> result = ResponseEntity.badRequest().build();
	try {
		if (StringUtils.isNotBlank(slackId)) {
			employeeService.deleteBySlackId(slackId);
			result = ResponseEntity.ok().build();
		}
	} catch (Exception e) {
		logger.error("Exception while deleting employee.", e);
		result = ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
	}
	return result;
}
 
开发者ID:Zymr,项目名称:visitormanagement,代码行数:14,代码来源:EmployeeResource.java

示例9: groupDelete

@ResponseBody
@RequiresPermissions("system:group:delete")
@MumuLog(name = "删除用户群组",operater = "DELETE")
@RequestMapping(value="/delete/{groupId}",method=RequestMethod.DELETE)
public ResponseEntity groupDelete(@PathVariable String groupId){
	try {
		groupService.deleteSysGroupById(groupId);
		return new ResponseEntity(200,"删除用户组成功",null);
	} catch (Exception e) {
		log.error(e);
		return new ResponseEntity(500, "删除用户组出现异常!", null);
	}
}
 
开发者ID:babymm,项目名称:mumu,代码行数:13,代码来源:SystemGroupController.java

示例10: removeCustomer

/**
 * Deletes the customer with given customer id if it exists and returns
 * HTTP204.
 *
 * @param customerId
 *            the customer id
 */
@RequestMapping(value = "/customers/{customerId}", method = RequestMethod.DELETE)
public void removeCustomer(@PathVariable("customerId") Long customerId, HttpServletResponse httpResponse) {

	if (customerRepository.exists(customerId)) {
		customerRepository.delete(customerId);
	}

	httpResponse.setStatus(HttpStatus.NO_CONTENT.value());
}
 
开发者ID:ShiftLeftSecurity,项目名称:HelloShiftLeft,代码行数:16,代码来源:CustomerController.java

示例11: deleteEvent

@RequestMapping(value="/delete.html", method={RequestMethod.DELETE, RequestMethod.GET})
public String deleteEvent(Model model){
	
	String transactionType = "Simple DELETE Transaction";
	model.addAttribute("transactionType", transactionType);
	return "delete";
}
 
开发者ID:PacktPublishing,项目名称:Spring-5.0-Cookbook,代码行数:7,代码来源:SimplePatternsController.java

示例12: removePage

/**
 * Removes a page by the specified request.
 * 
 * <p>
 * Renders the response with a json object, for example,
 * 
 * <pre>
 * {
 *     "sc": boolean,
 *     "msg": ""
 * }
 * </pre>
 * </p>
 *
 * @param request
 *            the specified http servlet request
 * @param response
 *            the specified http servlet response
 * @param context
 *            the specified http request context
 * @throws Exception
 *             exception
 */
@RequestMapping(value = "/console/page/*", method = RequestMethod.DELETE)
public void removePage(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
	if (!userQueryService.isAdminLoggedIn(request)) {
		response.sendError(HttpServletResponse.SC_FORBIDDEN);
		return;
	}

	final JSONRenderer renderer = new JSONRenderer();
	final JSONObject jsonObject = new JSONObject();
	renderer.setJSONObject(jsonObject);

	try {
		final String pageId = request.getRequestURI()
				.substring((Latkes.getContextPath() + "/console/page/").length());

		pageMgmtService.removePage(pageId);

		jsonObject.put(Keys.STATUS_CODE, true);
		jsonObject.put(Keys.MSG, langPropsService.get("removeSuccLabel"));
	} catch (final Exception e) {
		logger.error(e.getMessage(), e);

		jsonObject.put(Keys.STATUS_CODE, false);
		jsonObject.put(Keys.MSG, langPropsService.get("removeFailLabel"));

	}
	renderer.render(request, response);
}
 
开发者ID:daima,项目名称:solo-spring,代码行数:51,代码来源:PageConsole.java

示例13: cancelSchedule

/**
 * 取消已设置的排期.
 * 
 * @param id 排期 id
 */
@RequestMapping(path = "/meetingRooms/schedule/{id}", method = RequestMethod.DELETE)
public Result<?> cancelSchedule(@PathVariable Long id) {
	Schedule schedule = scheduleRepository.findOne(id);
	scheduleRepository.delete(schedule);
	return DefaultResult.newResult();
}
 
开发者ID:7upcat,项目名称:agile-wroking-backend,代码行数:11,代码来源:MeetingRoomController.java

示例14: deleteAll

@RequestMapping(value = "", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.OK)
public void deleteAll() throws Exception {
	deploymentController.undeployAll();
	this.definitionRepository.deleteAll();
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-dashboard,代码行数:6,代码来源:ApplicationDefinitionController.java

示例15: addString

@RequestMapping(path = "/addstring", method = RequestMethod.DELETE, produces = MediaType.TEXT_PLAIN_VALUE)
@Override
public String addString(@RequestParam(name = "s") List<String> s) {
  return super.addString(s);
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:5,代码来源:CodeFirstSpringmvc.java


注:本文中的org.springframework.web.bind.annotation.RequestMethod.DELETE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。