Skip to content
Snippets Groups Projects
Commit 891dbe66 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6099 update processor-manager; handle if context user missing; don't creat...

OZG-6099 update processor-manager; handle if context user missing; don't creat bean for processor-manager
parent 410d51f6
No related branches found
No related tags found
No related merge requests found
......@@ -54,7 +54,7 @@
<user-manager-interface.version>2.1.0</user-manager-interface.version>
<bescheid-manager.version>1.13.0</bescheid-manager.version>
<processor-manager.version>0.4.0</processor-manager.version>
<processor-manager.version>0.4.1-SNAPSHOT</processor-manager.version>
<nachrichten-manager.version>2.9.0</nachrichten-manager.version>
<ozgcloud-starter.version>0.10.0</ozgcloud-starter.version>
<notification-manager.version>2.8.0</notification-manager.version>
......
......@@ -31,6 +31,7 @@ import org.springframework.stereotype.Component;
import de.ozgcloud.apilib.common.callcontext.CallContext;
import de.ozgcloud.apilib.common.callcontext.OzgCloudCallContextProvider;
import de.ozgcloud.apilib.user.OzgCloudUserId;
import de.ozgcloud.vorgang.callcontext.CallContextUser;
import de.ozgcloud.vorgang.callcontext.CurrentUserService;
import de.ozgcloud.vorgang.callcontext.VorgangManagerClientCallContextAttachingInterceptor;
import lombok.RequiredArgsConstructor;
......@@ -45,11 +46,11 @@ public class VorgangManagerCallContextProvider implements OzgCloudCallContextPro
@Override
public CallContext provideContext() {
var callContextBuilder = CallContext.builder().clientName(VorgangManagerClientCallContextAttachingInterceptor.VORGANG_MANAGER_CLIENT_NAME);
getUserId().ifPresent(callContextBuilder::userId);
findUserId().ifPresent(callContextBuilder::userId);
return callContextBuilder.build();
}
Optional<OzgCloudUserId> getUserId() {
return currentUserService.getUser().getUserId().map(OzgCloudUserId::from);
Optional<OzgCloudUserId> findUserId() {
return currentUserService.findUser().flatMap(CallContextUser::getUserId).map(OzgCloudUserId::from);
}
}
......@@ -7,29 +7,15 @@ import de.ozgcloud.apilib.common.callcontext.OzgCloudCallContextProvider;
import de.ozgcloud.apilib.user.GrpcOzgCloudUserProfileService;
import de.ozgcloud.apilib.user.OzgCloudUserProfileService;
import de.ozgcloud.apilib.user.UserProfileMapper;
import de.ozgcloud.apilib.vorgang.OzgCloudVorgangService;
import de.ozgcloud.apilib.vorgang.grpc.GrpcOzgCloudVorgangService;
import de.ozgcloud.apilib.vorgang.grpc.OzgCloudVorgangMapper;
import de.ozgcloud.apilib.vorgang.grpc.OzgCloudVorgangStubMapper;
import de.ozgcloud.user.grpc.userprofile.UserProfileServiceGrpc.UserProfileServiceBlockingStub;
import de.ozgcloud.vorgang.vorgang.VorgangServiceGrpc.VorgangServiceBlockingStub;
import net.devh.boot.grpc.client.inject.GrpcClient;
@Configuration
class VorgangProcessorConfiguration {
@GrpcClient("vorgang-manager")
private VorgangServiceBlockingStub vorgangServiceStub;
@GrpcClient("user-manager")
private UserProfileServiceBlockingStub userProfileServiceGrpc;
@Bean
OzgCloudVorgangService ozgCloudVorgangService(OzgCloudVorgangMapper mapper, OzgCloudVorgangStubMapper stubMapper,
OzgCloudCallContextProvider contextProvider) {
return new GrpcOzgCloudVorgangService(vorgangServiceStub, mapper, stubMapper, contextProvider);
}
@Bean
OzgCloudUserProfileService ozgCloudUserProfileService(UserProfileMapper mapper, OzgCloudCallContextProvider contextProvider) {
return new GrpcOzgCloudUserProfileService(userProfileServiceGrpc, mapper, contextProvider);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment