Updated examples.

This commit is contained in:
Erik C. Thauvin 2020-03-07 16:18:22 -08:00
parent 149bbff4ae
commit 1e0de8b920
4 changed files with 13 additions and 7 deletions

View file

@ -13,7 +13,13 @@ repositories {
} }
dependencies { dependencies {
implementation("net.thauvin.erik:akismet-kotlin:0.9.0-beta") // Align versions of all Kotlin components
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation(kotlin("stdlib"))
implementation("javax.servlet:javax.servlet-api:4.0.1")
implementation("net.thauvin.erik:akismet-kotlin:0.9.1-beta")
} }
application { application {

View file

@ -20,7 +20,7 @@ public class AkismetSample {
comment.setAuthorUrl("http://www.CheckOutMyCoolSite.com"); comment.setAuthorUrl("http://www.CheckOutMyCoolSite.com");
comment.setDateGmt(Akismet.dateToGmt(new Date())); comment.setDateGmt(Akismet.dateToGmt(new Date()));
// comment.setUserRole(AkismetComment.ADMIN_ROLE); // comment.setUserRole(AkismetComment.ADMIN_ROLE);
comment.setContent("It means a lot that you would take the time to review our software. Thanks again."); comment.setContent("It means a lot that you would take the time to review our software. Thanks again.");
// final ConsoleHandler consoleHandler = new ConsoleHandler(); // final ConsoleHandler consoleHandler = new ConsoleHandler();
// consoleHandler.setLevel(Level.FINE); // consoleHandler.setLevel(Level.FINE);

View file

@ -20,7 +20,7 @@ fun main() {
authorUrl = "http://www.CheckOutMyCoolSite.com" authorUrl = "http://www.CheckOutMyCoolSite.com"
dateGmt = Akismet.dateToGmt(Date()) dateGmt = Akismet.dateToGmt(Date())
// userRole = AkismetComment.ADMIN_ROLE // userRole = AkismetComment.ADMIN_ROLE
content = "It means a lot that you would take the time to review our software. Thanks again." content = "It means a lot that you would take the time to review our software. Thanks again."
} }
// with(akismet.logger) { // with(akismet.logger) {

View file

@ -48,10 +48,10 @@ class AkismetServlet : HttpServlet() {
@Suppress("UNUSED_PARAMETER") @Suppress("UNUSED_PARAMETER")
private fun saveComment( private fun saveComment(
id: String, id: String,
name: String, name: String?,
email: String, email: String?,
date: String, date: String?,
comment: String, comment: String?,
json: String, json: String,
isSpam: Boolean isSpam: Boolean
) { ) {