generated from it-at-m/oss-repository-en-template
-
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.
Merge pull request #278 from it-at-m/151-erstellung-api
151 erstellung api
- Loading branch information
Showing
54 changed files
with
894 additions
and
7 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
83 changes: 83 additions & 0 deletions
83
.github/workflows/dispatch-eai-microservice-mvn-release.yml
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,83 @@ | ||
name: dispatch eai microserivce maven release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release-version: | ||
required: true | ||
description: release version to build | ||
development-version: | ||
required: true | ||
description: next development version to set | ||
service: | ||
required: true | ||
description: service/directory to build (wls-broadcast-service, ...) | ||
|
||
jobs: | ||
run-mvn-release-prepare: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v4 | ||
- name: Setup git user | ||
uses: fregante/setup-git-user@v2 | ||
- name: Install Java and Maven | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: "temurin" | ||
cache: 'maven' | ||
cache-dependency-path: '${{ github.event.inputs.service }}/pom.xml' | ||
- name: Perform maven release | ||
run: > | ||
mvn -B -ntp release:prepare -f ${{ github.event.inputs.service }}/pom.xml | ||
-DreleaseVersion=${{ github.event.inputs.release-version }} | ||
-DdevelopmentVersion=${{ github.event.inputs.development-version }} | ||
-Dtag=${{ github.event.inputs.service }}/${{ github.event.inputs.release-version }} | ||
-Darguments="-DskipTests" | ||
build-github-release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
needs: | ||
- run-mvn-release-prepare | ||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.inputs.service }}/${{ github.event.inputs.release-version }} | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
cache: 'maven' | ||
cache-dependency-path: '${{ github.event.inputs.service }}/pom.xml' | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: build jar without tests | ||
run: mvn -B -ntp -DskipTests verify -f ${{ github.event.inputs.service }}/pom.xml | ||
|
||
- name: Create GitHub Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: "${{ github.event.inputs.service }}/target/*.jar\n${{ github.event.inputs.service }}/target/openapi.json" | ||
tag_name: ${{ github.event.inputs.service }}/${{ github.event.inputs.release-version }} | ||
draft: false | ||
prerelease: false | ||
generate_release_notes: false | ||
|
||
build-github-container-image: | ||
permissions: | ||
packages: write | ||
needs: | ||
- run-mvn-release-prepare | ||
uses: | ||
./.github/workflows/callable-create-github-container-image.yml | ||
with: | ||
tag: ${{ github.event.inputs.service }}/${{ github.event.inputs.release-version }} | ||
service: ${{ github.event.inputs.service }} |
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
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
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
5 changes: 5 additions & 0 deletions
5
.../src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/rest/common/dto/WahlartDTO.java
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 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.rest.common.dto; | ||
|
||
public enum WahlartDTO { | ||
BAW, BEB, BTW, BZW, EUW, LTW, MBW, OBW, SRW, SVW, VE | ||
} |
20 changes: 20 additions & 0 deletions
20
.../de/muenchen/oss/wahllokalsystem/eaiservice/rest/common/exception/ExceptionConstants.java
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 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.rest.common.exception; | ||
|
||
public class ExceptionConstants { | ||
|
||
public static final String CODE_DATENALLGEMEIN_ID_NICHT_KONVERTIERBAR = "103"; | ||
|
||
public static final String CODE_FEHLER_BEI_KOMMUNIKATIONS_MIT_FREMDSYSTEM = "901"; | ||
public static final String MESSAGE_FEHLER_BEI_KOMMUNIKATIONS_MIT_FREMDSYSTEM = "Fremdsystem hat Fehler geworfen"; | ||
public static final String MESSAGE_FEHLER_BEI_KOMMUNIKATIONS_MIT_FREMDSYSTEM_MIT_MESSAGE = "Fremdsystem hat Fehler geworfen: %s"; | ||
|
||
public static final String CODE_DATENALLGEMEIN_PARAMETER_FEHLEN = "102"; | ||
public static final String MESSAGE_DATENALLGEMEIN_PARAMETER_FEHLEN = "Anfrage ist ungueltig da notwendige Anfragedaten fehlen"; | ||
|
||
/** | ||
* @throws IllegalAccessException when constructor is used | ||
*/ | ||
private ExceptionConstants() throws IllegalAccessException { | ||
throw new IllegalAccessException("dont create instanced - it is just a holder for constants"); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...e/muenchen/oss/wahllokalsystem/eaiservice/rest/common/exception/ExceptionDataWrapper.java
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,6 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.rest.common.exception; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
|
||
public record ExceptionDataWrapper(@NotNull String code, @NotNull String message) { | ||
} |
21 changes: 21 additions & 0 deletions
21
...enchen/oss/wahllokalsystem/eaiservice/rest/wahlbeteiligung/WahlbeteiligungController.java
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,21 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.rest.wahlbeteiligung; | ||
|
||
import de.muenchen.oss.wahllokalsystem.eaiservice.rest.wahlbeteiligung.dto.WahlbeteiligungsMeldungDTO; | ||
import jakarta.validation.Valid; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("/wahlbeteiligung") | ||
public class WahlbeteiligungController { | ||
|
||
@PostMapping | ||
@ResponseStatus(HttpStatus.OK) | ||
public void saveWahlbeteiligung(@Valid @RequestBody WahlbeteiligungsMeldungDTO wahlbeteiligung) { | ||
throw new UnsupportedOperationException("Not supported yet."); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...n/oss/wahllokalsystem/eaiservice/rest/wahlbeteiligung/dto/WahlbeteiligungsMeldungDTO.java
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,11 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.rest.wahlbeteiligung.dto; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotNull; | ||
import java.time.LocalDateTime; | ||
|
||
public record WahlbeteiligungsMeldungDTO(@NotNull String wahlID, | ||
@NotNull String wahlbezirkID, | ||
@Schema(requiredMode = Schema.RequiredMode.REQUIRED) long anzahlWaehler, | ||
@NotNull LocalDateTime meldeZeitpunkt) { | ||
} |
28 changes: 28 additions & 0 deletions
28
...hen/oss/wahllokalsystem/eaiservice/rest/wahlbeteiligung/exception/ExceptionConstants.java
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 @@ | ||
package de.muenchen.oss.wahllokalsystem.eaiservice.rest.wahlbeteiligung.exception; | ||
|
||
import de.muenchen.oss.wahllokalsystem.eaiservice.rest.common.exception.ExceptionDataWrapper; | ||
|
||
public class ExceptionConstants { | ||
|
||
public static final String CODE_SAVEWAHLBETEILIGUNG_WAHLBEZIRKID_FEHLT = "001"; | ||
public static final String MESSAGE_SAVEWAHLBETEILIGUNG_WAHLBEZIRKID_FEHLT = "Die WahlbezirkID fehlt"; | ||
public static final ExceptionDataWrapper SAVEWAHLBETEILIGUNG_WAHLBEZIRKID_FEHLT = new ExceptionDataWrapper(CODE_SAVEWAHLBETEILIGUNG_WAHLBEZIRKID_FEHLT, | ||
MESSAGE_SAVEWAHLBETEILIGUNG_WAHLBEZIRKID_FEHLT); | ||
|
||
public static final String CODE_SAVEWAHLBETEILIGUNG_WAHLID_FEHLT = "002"; | ||
public static final String MESSAGE_SAVEWAHLBETEILIGUNG_WAHLID_FEHLT = "Die WahlID fehlt"; | ||
public static final ExceptionDataWrapper SAVEWAHLBETEILIGUNG_WAHLID_FEHLT = new ExceptionDataWrapper(CODE_SAVEWAHLBETEILIGUNG_WAHLID_FEHLT, | ||
MESSAGE_SAVEWAHLBETEILIGUNG_WAHLID_FEHLT); | ||
|
||
public static final String CODE_SAVEWAHLBETEILIGUNG_MELDEZEITPUNKT_FEHLT = "003"; | ||
public static final String MESSAGE_SAVEWAHLBETEILIGUNG_MELDEZEITPUNKT_FEHLT = "Der Meldezeitpunkt fehlt"; | ||
public static final ExceptionDataWrapper SAVEWAHLBETEILIGUNG_MELDEZEITPUNKT_FEHLT = new ExceptionDataWrapper(CODE_SAVEWAHLBETEILIGUNG_MELDEZEITPUNKT_FEHLT, | ||
MESSAGE_SAVEWAHLBETEILIGUNG_MELDEZEITPUNKT_FEHLT); | ||
|
||
/** | ||
* @throws IllegalAccessException when constructor is used | ||
*/ | ||
private ExceptionConstants() throws IllegalAccessException { | ||
throw new IllegalAccessException("dont create instanced - it is just a holder for constants"); | ||
} | ||
} |
Oops, something went wrong.