use of run.halo.app.model.enums.CommentViolationTypeEnum in project halo by ruibaby.
the class PostCommentServiceImpl method validateCommentBlackListStatus.
@Override
public void validateCommentBlackListStatus() {
CommentViolationTypeEnum banStatus = commentBlackListService.commentsBanStatus(ServletUtils.getRequestIp());
Integer banTime = optionService.getByPropertyOrDefault(CommentProperties.COMMENT_BAN_TIME, Integer.class, 10);
if (banStatus == CommentViolationTypeEnum.FREQUENTLY) {
throw new ForbiddenException(String.format("您的评论过于频繁,请%s分钟之后再试。", banTime));
}
}
use of run.halo.app.model.enums.CommentViolationTypeEnum in project halo by halo-dev.
the class PostCommentServiceImpl method validateCommentBlackListStatus.
@Override
public void validateCommentBlackListStatus() {
CommentViolationTypeEnum banStatus = commentBlackListService.commentsBanStatus(ServletUtils.getRequestIp());
Integer banTime = optionService.getByPropertyOrDefault(CommentProperties.COMMENT_BAN_TIME, Integer.class, 10);
if (banStatus == CommentViolationTypeEnum.FREQUENTLY) {
throw new ForbiddenException(String.format("您的评论过于频繁,请%s分钟之后再试。", banTime));
}
}
use of run.halo.app.model.enums.CommentViolationTypeEnum in project halo-plugin-experimental by guqing.
the class PostCommentServiceImpl method validateCommentBlackListStatus.
@Override
public void validateCommentBlackListStatus() {
CommentViolationTypeEnum banStatus = commentBlackListService.commentsBanStatus(ServletUtils.getRequestIp());
Integer banTime = optionService.getByPropertyOrDefault(CommentProperties.COMMENT_BAN_TIME, Integer.class, 10);
if (banStatus == CommentViolationTypeEnum.FREQUENTLY) {
throw new ForbiddenException(String.format("您的评论过于频繁,请%s分钟之后再试。", banTime));
}
}
Aggregations