本文整理汇总了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();
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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,"消息删除成功","");
}
示例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;
}
示例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);
}
}
示例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());
}
示例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";
}
示例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);
}
示例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();
}
示例14: deleteAll
@RequestMapping(value = "", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.OK)
public void deleteAll() throws Exception {
deploymentController.undeployAll();
this.definitionRepository.deleteAll();
}
示例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);
}