本文整理匯總了Java中br.com.caelum.vraptor.Delete類的典型用法代碼示例。如果您正苦於以下問題:Java Delete類的具體用法?Java Delete怎麽用?Java Delete使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Delete類屬於br.com.caelum.vraptor包,在下文中一共展示了Delete類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: delete
import br.com.caelum.vraptor.Delete; //導入依賴的package包/類
@Delete
public void delete(Long commentId, String onWhat, Long postId) {
Comment comment = comments.getById(commentId);
if (!environment.supports("deletable.comments") || comment == null) {
result.notFound();
return;
}
if (!currentUser.isModerator() && !comment.hasAuthor(currentUser.getCurrent())) {
result.use(http()).sendError(403);
return;
}
Class<?> type = urlMapping.getClassFor(onWhat);
org.mamute.model.Post post = comments.loadCommentable(type, postId);
post.deleteComment(comment);
comments.delete(comment);
result.use(Results.referer()).redirect();
}
示例2: remover
import br.com.caelum.vraptor.Delete; //導入依賴的package包/類
@Delete
@Path(value = "/{id}")
public void remover(Long id) {
contatos.desativarComId(id);
result.use(status()).ok();
}
示例3: instanceOfMethodAnnotation
import br.com.caelum.vraptor.Delete; //導入依賴的package包/類
private Predicate<Annotation> instanceOfMethodAnnotation() {
return or(instanceOf(Get.class), instanceOf(Post.class), instanceOf(Put.class), instanceOf(Delete.class), instanceOf(Options.class), instanceOf(Patch.class));
}
示例4: remove
import br.com.caelum.vraptor.Delete; //導入依賴的package包/類
@Path("/clients/remove")
@Delete
public void remove() {
}