Skip to content

Commit

Permalink
Throw away JavaScript
Browse files Browse the repository at this point in the history
  • Loading branch information
pvorb committed Jun 26, 2018
1 parent f6920be commit bbde5ed
Show file tree
Hide file tree
Showing 62 changed files with 3,319 additions and 723 deletions.
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
/target/
/.idea/
/*.iml
/*.db

*.log

/node/
/node_modules/

/src/main/webapp/js/

/application.properties
/config/
82 changes: 44 additions & 38 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.2.RELEASE</version>
<version>2.0.3.RELEASE</version>
</parent>

<properties>
Expand All @@ -51,6 +51,8 @@
<commons-codec.version>1.10</commons-codec.version>
<owasp-java-html.version>20180219.1</owasp-java-html.version>
<encoder.version>1.2</encoder.version>
<rome.version>1.10.0</rome.version>
<bootstrap.version>4.1.1</bootstrap.version>

<!-- Testing -->
<openpojo.version>0.8.4</openpojo.version>
Expand All @@ -62,8 +64,9 @@
<skipITs>false</skipITs>

<!-- Database -->
<db.url>jdbc:h2:file:./platon</db.url>
<db.username>sa</db.username>
<db.url>jdbc:postgresql://localhost:5432/platon_jooq_codegen</db.url>
<db.username>postgres</db.username>
<db.password>postgres</db.password>
</properties>

<dependencies>
Expand All @@ -86,6 +89,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
Expand All @@ -95,17 +103,19 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.googlecode.owasp-java-html-sanitizer</groupId>
Expand All @@ -123,19 +133,29 @@
<artifactId>spring-boot-starter-jooq</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>

<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>${flyway.version}</version>
<groupId>com.rometools</groupId>
<artifactId>rome</artifactId>
<version>${rome.version}</version>
</dependency>

<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>

<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>${bootstrap.version}</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -273,6 +293,7 @@
<configuration>
<url>${db.url}</url>
<user>${db.username}</user>
<password>${db.password}</password>
</configuration>
</plugin>
<plugin>
Expand All @@ -291,33 +312,29 @@

<dependencies>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>
</dependencies>

<configuration>

<jdbc>
<driver>org.h2.Driver</driver>
<driver>org.postgresql.Driver</driver>
<url>${db.url}</url>
<user>${db.username}</user>
<password>${db.password}</password>
</jdbc>

<generator>
<database>
<name>org.jooq.util.h2.H2Database</name>
<name>org.jooq.util.postgres.PostgresDatabase</name>
<inputSchema>public</inputSchema>
<excludes>public\.flyway_schema_history</excludes>
<includes>.*</includes>
<excludes>schema_version</excludes>
<inputSchema>PUBLIC</inputSchema>

<forcedTypes>
<forcedType>
<userType>java.time.Instant</userType>
<converter>de.vorb.platon.persistence.conversion.InstantConverter</converter>
<types>TIMESTAMP</types>
</forcedType>
<forcedType>
<userType>de.vorb.platon.model.CommentStatus</userType>
<converter>de.vorb.platon.persistence.conversion.CommentStatusConverter</converter>
Expand All @@ -327,25 +344,14 @@
</database>

<target>
<packageName>de.vorb.platon.jooq</packageName>
<directory>target/generated-sources/jooq</directory>
<packageName>de.vorb.platon.persistence.jooq</packageName>
<directory>${project.build.sourceDirectory}</directory>
</target>

<generate>
<relations>true</relations>
<deprecated>false</deprecated>
<instanceFields>true</instanceFields>
<generatedAnnotation>true</generatedAnnotation>
<records>true</records>
<pojos>true</pojos>
<pojosEqualsAndHashCode>true</pojosEqualsAndHashCode>
<immutablePojos>false</immutablePojos>
<interfaces>false</interfaces>
<daos>false</daos>
<jpaAnnotations>false</jpaAnnotations>
<validationAnnotations>true</validationAnnotations>
<springAnnotations>false</springAnnotations>
<globalObjectReferences>true</globalObjectReferences>
<javaTimeTypes>true</javaTimeTypes>
<fluentSetters>true</fluentSetters>
</generate>
</generator>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package de.vorb.platon.persistence;

import de.vorb.platon.jooq.tables.pojos.Comment;
import de.vorb.platon.persistence.jooq.tables.pojos.Comment;
import de.vorb.platon.model.CommentStatus;

import java.util.List;
Expand All @@ -26,7 +26,7 @@

public interface CommentRepository {

List<Comment> findByThreadUrl(String threadUrl);
List<Comment> findByThreadId(long threadId);

Optional<Comment> findById(long id);

Expand Down
11 changes: 10 additions & 1 deletion src/main/java/de/vorb/platon/persistence/ThreadRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,23 @@

package de.vorb.platon.persistence;

import de.vorb.platon.jooq.tables.pojos.CommentThread;
import de.vorb.platon.persistence.jooq.tables.pojos.CommentThread;

import java.util.List;
import java.util.Optional;

public interface ThreadRepository {

CommentThread getById(long id);

Optional<Long> findThreadIdForUrl(String threadUrl);

Optional<CommentThread> findThreadForUrl(String threadUrl);

List<CommentThread> findThreadsForUrlPrefix(String threadUrlPrefix);

CommentThread insert(CommentThread thread);

void updateThreadTitle(long id, String newTitle);

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package de.vorb.platon.persistence.impl;

import de.vorb.platon.jooq.tables.pojos.Comment;
import de.vorb.platon.jooq.tables.records.CommentRecord;
import de.vorb.platon.model.CommentStatus;
import de.vorb.platon.persistence.CommentRepository;
import de.vorb.platon.persistence.jooq.tables.pojos.Comment;
import de.vorb.platon.persistence.jooq.tables.records.CommentRecord;

import lombok.RequiredArgsConstructor;
import org.jooq.DSLContext;
Expand All @@ -31,8 +31,8 @@
import java.util.Optional;
import java.util.Set;

import static de.vorb.platon.jooq.Tables.COMMENT;
import static de.vorb.platon.jooq.Tables.COMMENT_THREAD;
import static de.vorb.platon.persistence.jooq.Tables.COMMENT;
import static de.vorb.platon.persistence.jooq.Tables.COMMENT_THREAD;
import static org.jooq.impl.DSL.count;

@Repository
Expand All @@ -42,11 +42,11 @@ public class JooqCommentRepository implements CommentRepository {
private final DSLContext dslContext;

@Override
public List<Comment> findByThreadUrl(String threadUrl) {
return dslContext
.selectFrom(COMMENT
.join(COMMENT_THREAD).on(COMMENT.THREAD_ID.eq(COMMENT_THREAD.ID)))
.where(COMMENT_THREAD.URL.eq(threadUrl))
public List<Comment> findByThreadId(long threadId) {
return dslContext.select(COMMENT.fields())
.from(COMMENT)
.where(COMMENT.THREAD_ID.eq(threadId))
.orderBy(COMMENT.ID.asc())
.fetchInto(Comment.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

package de.vorb.platon.persistence.impl;

import de.vorb.platon.jooq.tables.records.PropertyRecord;
import de.vorb.platon.persistence.jooq.tables.records.PropertyRecord;
import de.vorb.platon.persistence.PropertyRepository;

import lombok.RequiredArgsConstructor;
import org.jooq.DSLContext;
import org.springframework.stereotype.Repository;

import static de.vorb.platon.jooq.tables.Property.PROPERTY;
import static de.vorb.platon.persistence.jooq.tables.Property.PROPERTY;

@Repository
@RequiredArgsConstructor
Expand Down
Loading

0 comments on commit bbde5ed

Please sign in to comment.