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 #458 from it-at-m/148-implementierung-der-pflege-v…
…on-wahltermindaten 148 implementierung der pflege von wahltermindaten
- Loading branch information
Showing
39 changed files
with
2,323 additions
and
22 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
21 changes: 21 additions & 0 deletions
21
stack/keycloak/migration/add-authorities-basisdaten-wahltermindaten.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,21 @@ | ||
id: add authorities basisdaten wahltermindaten | ||
author: MrSebastian | ||
realm: ${SSO_REALM} | ||
changes: | ||
- addRole: | ||
name: Basisdaten_BUSINESSACTION_PutWahltermindaten | ||
clientRole: true | ||
clientId: ${SSO_CLIENT_ID} | ||
- assignRoleToGroup: | ||
group: allBasisdatenAuthorities | ||
role: Basisdaten_BUSINESSACTION_PutWahltermindaten | ||
clientId: ${SSO_CLIENT_ID} | ||
|
||
- addRole: | ||
name: Basisdaten_BUSINESSACTION_DeleteWahltermindaten | ||
clientRole: true | ||
clientId: ${SSO_CLIENT_ID} | ||
- assignRoleToGroup: | ||
group: allBasisdatenAuthorities | ||
role: Basisdaten_BUSINESSACTION_DeleteWahltermindaten | ||
clientId: ${SSO_CLIENT_ID} |
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
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
42 changes: 42 additions & 0 deletions
42
...a/de/muenchen/oss/wahllokalsystem/basisdatenservice/configuration/AsyncConfiguration.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,42 @@ | ||
package de.muenchen.oss.wahllokalsystem.basisdatenservice.configuration; | ||
|
||
import lombok.val; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.scheduling.annotation.EnableAsync; | ||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
import org.springframework.security.task.DelegatingSecurityContextAsyncTaskExecutor; | ||
|
||
@EnableAsync | ||
@Configuration | ||
public class AsyncConfiguration { | ||
|
||
@Value("${app.async.corePoolSize}") | ||
public int corePoolSize; | ||
|
||
@Value("${app.async.maxPoolSize}") | ||
public int maxPoolSize; | ||
|
||
@Value("${app.async.queueCapacity}") | ||
public int queueCapacity; | ||
|
||
@Value("${app.async.threadNamePrefix}") | ||
public String threadNamePrefix; | ||
|
||
@Bean | ||
public ThreadPoolTaskExecutor threadPoolTaskExecutor() { | ||
val executor = new ThreadPoolTaskExecutor(); | ||
executor.setCorePoolSize(corePoolSize); | ||
executor.setMaxPoolSize(maxPoolSize); | ||
executor.setQueueCapacity(queueCapacity); | ||
executor.setThreadNamePrefix(threadNamePrefix); | ||
executor.initialize(); | ||
return executor; | ||
} | ||
|
||
@Bean | ||
public DelegatingSecurityContextAsyncTaskExecutor taskExecutor(final ThreadPoolTaskExecutor threadPoolTaskExecutor) { | ||
return new DelegatingSecurityContextAsyncTaskExecutor(threadPoolTaskExecutor); | ||
} | ||
} |
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
70 changes: 70 additions & 0 deletions
70
...oss/wahllokalsystem/basisdatenservice/rest/wahltermindaten/WahltermindatenController.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,70 @@ | ||
package de.muenchen.oss.wahllokalsystem.basisdatenservice.rest.wahltermindaten; | ||
|
||
import de.muenchen.oss.wahllokalsystem.basisdatenservice.eai.aou.model.WlsExceptionDTO; | ||
import de.muenchen.oss.wahllokalsystem.basisdatenservice.services.wahltermindaten.WahltermindatenService; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PutMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("/businessActions/") | ||
@RequiredArgsConstructor | ||
@Slf4j | ||
public class WahltermindatenController { | ||
|
||
private final WahltermindatenService wahltermindatenService; | ||
|
||
@Operation( | ||
description = "Triggert die Einrichtung der Wahltermindaten.", | ||
responses = { | ||
@ApiResponse( | ||
responseCode = "200", description = "Die Wahltermindaten werden angelegt." | ||
), | ||
@ApiResponse( | ||
responseCode = "400", description = "Es gibt keine Wahltag zu der ID", | ||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = WlsExceptionDTO.class)) | ||
), | ||
@ApiResponse( | ||
responseCode = "500", description = "Fehler während der Einrichtung", | ||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = WlsExceptionDTO.class)) | ||
) | ||
} | ||
) | ||
@PutMapping("wahltermindaten/{wahltagID}") | ||
@ResponseStatus(HttpStatus.OK) | ||
public void putWahltermindaten(@PathVariable("wahltagID") String wahltagID) { | ||
wahltermindatenService.putWahltermindaten(wahltagID); | ||
} | ||
|
||
@Operation( | ||
description = "Löscht die Wahltermindaten eines bestimmten Wahltags.", | ||
responses = { | ||
@ApiResponse( | ||
responseCode = "200", description = "Die Wahltermindaten werden gelöscht." | ||
), | ||
@ApiResponse( | ||
responseCode = "400", description = "Es gibt keine Wahltag zu der ID", | ||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = WlsExceptionDTO.class)) | ||
), | ||
@ApiResponse( | ||
responseCode = "500", description = "Fehler während des Löschens", | ||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = WlsExceptionDTO.class)) | ||
) | ||
} | ||
) | ||
@DeleteMapping("wahltermindaten/{wahltagID}") | ||
@ResponseStatus(HttpStatus.OK) | ||
public void deleteWahltermindaten(@PathVariable("wahltagID") String wahltagID) { | ||
wahltermindatenService.deleteWahltermindaten(wahltagID); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ce/services/wahlen/WahltagWithNummer.java → ...ce/services/common/WahltagWithNummer.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
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
2 changes: 1 addition & 1 deletion
2
...de/muenchen/oss/wahllokalsystem/basisdatenservice/services/kopfdaten/WahldatenClient.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
1 change: 1 addition & 0 deletions
1
.../java/de/muenchen/oss/wahllokalsystem/basisdatenservice/services/wahlen/WahlenClient.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
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
Oops, something went wrong.