Skip to content

Instantly share code, notes, and snippets.

View zachpendleton's full-sized avatar

Zach Pendleton zachpendleton

View GitHub Profile
---
version: "3.8"
services:
postgres:
image: postgres:alpine
environment:
POSTGRES_PASSWORD: password
POSTGRES_USER: course_catalog
POSTGRES_DB: course_catalog_development
ports:
plugins {
id 'org.springframework.boot' version '2.5.1'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '16'
CREATE TABLE courses (
id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
name TEXT NOT NULL,
start_at TIMESTAMPTZ,
visibility TEXT NOT NULL DEFAULT 'VISIBLE',
seats INT NOT NULL DEFAULT 0,
enrollment_active BOOLEAN NOT NULL DEFAULT TRUE,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ
)
package com.example.demo.repository;
import static com.example.demo.generated.jooq.Tables.COURSES;
import com.example.demo.generated.jooq.tables.records.CoursesRecord;
import com.example.demo.model.Course;
import com.example.demo.model.Course.Visibility;
import java.util.List;
import java.util.Optional;
import org.jooq.DSLContext;
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder" />
</appender>
<root level="info">
<appender-ref ref="STDOUT" />
</root>
</configuration>
package com.example.demo.actuator;
import com.example.demo.model.Course;
import com.example.demo.repository.CoursesRepository;
import java.util.List;
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.annotation.WriteOperation;
import org.springframework.stereotype.Component;
allprojects {
apply plugin: 'java'
group 'com.instructure'
version '0.0-SNAPSHOT'
repositories {
mavenCentral()
}
apply plugin: 'java-library'
dependencies {
annotationProcessor 'org.springframework.boot:spring-boot-autoconfigure-processor:2.5.2'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor:2.5.2'
implementation 'org.springframework.boot:spring-boot-starter:2.5.2'
api project(':multi-module-greeter')
}