新增发送消息接口

This commit is contained in:
chuzhongzai 2024-08-20 17:09:24 +08:00
parent 0cc583b910
commit 25cd6d73b6
3 changed files with 15 additions and 2 deletions

View File

@ -101,7 +101,6 @@
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-all</artifactId> <artifactId>netty-all</artifactId>
<version>4.1.105.Final</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -94,4 +94,9 @@ public class PersonalController {
public String ip() throws JsonProcessingException { public String ip() throws JsonProcessingException {
return personalService.getIp(); return personalService.getIp();
} }
@PostMapping("/message2me")
public String message2me(String message) {
return personalService.message2me(message);
}
} }

View File

@ -61,11 +61,14 @@ public class PersonalServiceImpl{
ExecutorService compressThreadPool; ExecutorService compressThreadPool;
public PersonalServiceImpl(CustomConfigurationMapper configurationMapper, UserMapper userMapper, ShareFileMapper shareFileMapper, TaskHandlerInterceptor taskHandlerInterceptor){ PushService pushService;
public PersonalServiceImpl(CustomConfigurationMapper configurationMapper, UserMapper userMapper, ShareFileMapper shareFileMapper, TaskHandlerInterceptor taskHandlerInterceptor, PushService pushService){
this.configurationMapper = configurationMapper; this.configurationMapper = configurationMapper;
this.userMapper = userMapper; this.userMapper = userMapper;
this.shareFileMapper = shareFileMapper; this.shareFileMapper = shareFileMapper;
this.taskHandlerInterceptor = taskHandlerInterceptor; this.taskHandlerInterceptor = taskHandlerInterceptor;
this.pushService = pushService;
compressThreadPool = Executors.newFixedThreadPool(1); compressThreadPool = Executors.newFixedThreadPool(1);
} }
@ -363,4 +366,10 @@ public class PersonalServiceImpl{
return response.toJSONString(); return response.toJSONString();
} }
public String message2me(String message){
Response response = Response.generateResponse();
pushService.sendToMe(message);
return response.success().toJSONString();
}
} }