任何人都可以告诉我"如何使用弹簧启动和websockets创建一对一的聊天应用程序"我有一个使用以下链接进行弹簧启动和websockets的示例,其中消息将发送给所有已连接的用户. https://www.callicoder.com/spring-boot-websocket-chat-example/
我想使应用程序像客户端和管理员之间的聊天,每个客户端和管理员之间的对话不能转到其他客户端.
如何在Spring Boot中使用mockito模拟mockRepository.deleteById() ?
我正在使用 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)