-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0c8c647
Showing
42 changed files
with
998 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Pull request max line checker | ||
|
||
on: [pull_request] | ||
|
||
concurrency : | ||
group: pull-request-max-lines_${{ github.head_ref }} | ||
cancel-in-progress : true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: codelytv/pr-size-labeler@v1 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
xs_max_size: '10' | ||
s_max_size: '100' | ||
m_max_size: '500' | ||
l_max_size: '1000' | ||
fail_if_xl: 'false' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Pull request style checker | ||
|
||
on: [pull_request] | ||
|
||
concurrency : | ||
group: pull-request-styler_${{ github.head_ref }} | ||
cancel-in-progress : true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '17' | ||
distribution: 'corretto' | ||
cache: gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Check code format | ||
run: ./gradlew ktlintCheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
HELP.md | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Utilizo un fichero TOML para la organización de las dependencias del proyecto, | ||
|
||
He creado un @UseCase para extender la semantica del inyector de depencendias de Spring, así además de las ya conocidas como @Repository @Service etc, sigo añadiendo nuevos tipos para poder tener más granularidad | ||
tratando así de evitar usar el @Component que es algo más generico | ||
|
||
Utilizo OpenFeign como client HTTP, que esta inspirado en Retrofit (https://github.com/OpenFeign/feign) | ||
|
||
Estamos usando Swagger con este repo https://springdoc.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
id("org.springframework.boot") version "3.0.5" | ||
id("io.spring.dependency-management") version "1.1.0" | ||
id("org.jlleitschuh.gradle.ktlint") version "11.3.1" | ||
kotlin("jvm") version "1.8.20" | ||
kotlin("plugin.spring") version "1.8.20" | ||
} | ||
|
||
group = "oscar.c.pozas" | ||
version = "0.0.1-SNAPSHOT" | ||
java.sourceCompatibility = JavaVersion.VERSION_17 | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
// Spring boot dependencies | ||
implementation(libs.springboot.web) | ||
implementation(libs.springboot.actuator) | ||
implementation(libs.springboot.cache) | ||
implementation(libs.springboot.data.redis) | ||
|
||
// Spring cloud dependencies | ||
implementation(libs.springcloud.openFeign) | ||
|
||
// Spring doc Open API Spec | ||
implementation(libs.springdoc.openapi) | ||
|
||
// Jackson parser | ||
implementation(libs.jackson.kotlin) | ||
|
||
// Postgres SQL Driver | ||
implementation(libs.postgresql) | ||
|
||
// Exposed Kotlin SQL DSL | ||
implementation(libs.exposed.core) | ||
implementation(libs.exposed.dao) | ||
implementation(libs.exposed.jdbc) | ||
|
||
// Shedlock scheduler | ||
implementation(libs.shedlock.spring) | ||
implementation(libs.shedlock.redis) | ||
|
||
// Test dependencies | ||
testImplementation(libs.springboot.test) | ||
} | ||
|
||
tasks.withType<KotlinCompile> { | ||
kotlinOptions { | ||
freeCompilerArgs = listOf("-Xjsr305=strict") | ||
jvmTarget = "17" | ||
} | ||
} | ||
|
||
tasks.withType<Test> { | ||
useJUnitPlatform() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
dependencyResolutionManagement { | ||
versionCatalogs { | ||
create("externalLibs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: "3.9" | ||
services: | ||
|
||
redis: | ||
image: redis | ||
container_name: redis-svc-kotlin-playground | ||
ports: | ||
- "6379:6379" | ||
|
||
database: | ||
image: postgres | ||
container_name: postgres-svc-kotlin-playground | ||
environment: | ||
POSTGRES_USER: root | ||
POSTGRES_DB: pokemon | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
volumes: | ||
- ./docker/postgres:/docker-entrypoint-initdb.d | ||
ports: | ||
- "15432:5432" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
create table if not exists pokemon( | ||
id serial primary key, | ||
pokedex integer not null, | ||
name varchar(50) not null | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[versions] | ||
kotlin = "1.8.20" | ||
shedlock = "5.2.0" | ||
exposed = "0.41.1" | ||
|
||
[libraries] | ||
kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } | ||
|
||
springboot-web = { module = "org.springframework.boot:spring-boot-starter-web" } | ||
springboot-actuator = { module = "org.springframework.boot:spring-boot-starter-actuator" } | ||
springboot-test = { module = "org.springframework.boot:spring-boot-starter-test" } | ||
springboot-cache = { module = "org.springframework.boot:spring-boot-starter-cache" } | ||
springboot-data-redis = { module = "org.springframework.boot:spring-boot-starter-data-redis" } | ||
|
||
springcloud-openFeign = { module = "org.springframework.cloud:spring-cloud-starter-openfeign", version = "4.0.2" } | ||
|
||
springdoc-openapi = { module = "org.springdoc:springdoc-openapi-starter-webmvc-ui", version = "2.1.0" } | ||
|
||
jackson-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin" } | ||
|
||
shedlock-spring = { module = "net.javacrumbs.shedlock:shedlock-spring", version.ref = "shedlock" } | ||
shedlock-redis = { module = "net.javacrumbs.shedlock:shedlock-provider-redis-spring", version.ref = "shedlock" } | ||
|
||
exposed-core = { module = "org.jetbrains.exposed:exposed-core", version.ref = "exposed" } | ||
exposed-dao = { module = "org.jetbrains.exposed:exposed-dao", version.ref = "exposed" } | ||
exposed-jdbc = { module = "org.jetbrains.exposed:exposed-jdbc", version.ref = "exposed" } | ||
|
||
postgresql = { module = "org.postgresql:postgresql", version = "42.2.27" } |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.