當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。