Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nachrichten-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OZG-Cloud
app
nachrichten-manager
Commits
81551fec
Commit
81551fec
authored
7 months ago
by
OZGCloud
Browse files
Options
Downloads
Patches
Plain Diff
OZG-6522 refactor deprecated old bayernid type
parent
baee1727
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nachrichten-manager-server/src/main/java/de/ozgcloud/nachrichten/postfach/PostfachService.java
+7
-11
7 additions, 11 deletions
...ava/de/ozgcloud/nachrichten/postfach/PostfachService.java
with
7 additions
and
11 deletions
nachrichten-manager-server/src/main/java/de/ozgcloud/nachrichten/postfach/PostfachService.java
+
7
−
11
View file @
81551fec
...
...
@@ -25,10 +25,10 @@ package de.ozgcloud.nachrichten.postfach;
import
java.time.ZonedDateTime
;
import
java.util.Collection
;
import
java.util.EnumSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.function.Supplier
;
import
java.util.stream.Stream
;
import
jakarta.annotation.PostConstruct
;
...
...
@@ -241,19 +241,15 @@ class PostfachService {
}
public
Stream
<
Postfach
>
getPostfachs
()
{
Supplier
<
Stream
<
PostfachRemoteService
>>
postfachRemoteServicesStream
=
()
->
postfachRemoteServices
.
stream
().
flatMap
(
Collection:
:
stream
);
var
oldBayernIdPostfachStream
=
buildOldBayernIdPostfach
(
postfachRemoteServicesStream
.
get
());
var
postfachsStream
=
postfachRemoteServicesStream
.
get
().
map
(
this
::
buildPostfach
);
return
Stream
.
concat
(
postfachsStream
,
oldBayernIdPostfachStream
);
return
postfachRemoteServices
.
stream
().
flatMap
(
Collection:
:
stream
).
map
(
this
::
getPostfaecher
).
flatMap
(
Collection:
:
stream
);
}
// TODO Nach Umstellung auf BAYERN_ID entfernen
private
Stream
<
Postfach
>
buildOldBayernIdPostfach
(
Stream
<
PostfachRemoteService
>
postfachRemoteServicesStream
)
{
return
postfachRemoteServicesStream
.
filter
(
remotePostfach
->
"BAYERN_ID"
.
equals
(
remotePostfach
.
getPostfachType
()))
.
map
(
remotePostfach
->
Postfach
.
builder
()
.
type
(
"BayernId"
)
.
isReplyAllowed
(
isReplyAllowed
(
remotePostfach
))
.
build
());
private
List
<
Postfach
>
getPostfaecher
(
PostfachRemoteService
remoteService
)
{
var
postfach
=
buildPostfach
(
remoteService
);
return
"BAYERN_ID"
.
equals
(
remoteService
.
getPostfachType
())
?
List
.
of
(
postfach
,
Postfach
.
builder
().
type
(
"BayernId"
).
isReplyAllowed
(
postfach
.
isReplyAllowed
()).
build
())
:
List
.
of
(
postfach
);
}
Postfach
buildPostfach
(
PostfachRemoteService
postfachRemoteService
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment