小编HAR*_*ISH的帖子

如何使用spring boot和websockets创建一对一的聊天应用程序

任何人都可以告诉我"如何使用弹簧启动和websockets创建一对一的聊天应用程序"我有一个使用以下链接进行弹簧启动和websockets的示例,其中消息将发送给所有已连接的用户. https://www.callicoder.com/spring-boot-websocket-chat-example/

我想使应用程序像客户端和管理员之间的聊天,每个客户端和管理员之间的对话不能转到其他客户端.

websocket spring-boot

7
推荐指数
1
解决办法
2968
查看次数

如何在 Spring Boot 中使用mockito 模拟deleteById

如何在Spring Boot中使用mockito模拟mockRepository.deleteById() ?

spring junit4 mockito spring-boot

3
推荐指数
1
解决办法
5586
查看次数

使用 Spring Boot 的 Microsoft Graph api 邮件服务

我正在使用 Microsoft Graph api 在 Spring Boot 应用程序中发送和接收邮件,

我使用了 graph api 的依赖项,例如

         <dependency>
             <groupId>com.microsoft.graph</groupId>
             <artifactId>microsoft-graph</artifactId>
             <version>3.5.0</version>
         </dependency>
         <dependency>
        <!-- This dependency is only needed if you are using the TokenCrendentialAuthProvider -->
        <groupId>com.azure</groupId>
        <artifactId>azure-identity</artifactId>
        <version>1.2.5</version>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

在代码中我的导入是

import com.azure.identity.ClientSecretCredential;
import com.azure.identity.ClientSecretCredentialBuilder;
import com.microsoft.graph.authentication.TokenCredentialAuthProvider;
import com.microsoft.graph.models.BodyType;
import com.microsoft.graph.models.EmailAddress;
import com.microsoft.graph.models.ItemBody;
import com.microsoft.graph.models.Message;
import com.microsoft.graph.models.Recipient;
import com.microsoft.graph.models.UserSendMailParameterSet;
import com.microsoft.graph.requests.GraphServiceClient;
import com.microsoft.graph.requests.MessageCollectionPage;
Run Code Online (Sandbox Code Playgroud)

代码出现错误

ClientSecretCredential clientSecretCredential = new ClientSecretCredentialBuilder()
            .clientId(CLIENT_ID)
            .clientSecret(CLIENT_SECRET).tenantId(TENANT_GUID).build();
    
    TokenCredentialAuthProvider tokenCredentialAuthProvider = new TokenCredentialAuthProvider(SCOPES, clientSecretCredential);


    GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( tokenCredentialAuthProvider ).buildClient();
    

    MessageCollectionPage messagesPage …
Run Code Online (Sandbox Code Playgroud)

java spring-boot microsoft-graph-api

1
推荐指数
1
解决办法
8012
查看次数