|
|
@ -77,12 +77,6 @@ public class AdminController {
|
|
|
|
// 管理员发送消息
|
|
|
|
// 管理员发送消息
|
|
|
|
@PostMapping("/sendMessage")
|
|
|
|
@PostMapping("/sendMessage")
|
|
|
|
public Result<String> sendMessage(@RequestBody @NotNull SendMessageDTO sendMessageDTO) {
|
|
|
|
public Result<String> sendMessage(@RequestBody @NotNull SendMessageDTO sendMessageDTO) {
|
|
|
|
LambdaQueryWrapper<User> userLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
|
|
|
userLambdaQueryWrapper.eq(User::getId, sendMessageDTO.getId());
|
|
|
|
|
|
|
|
User user = userService.getOne(userLambdaQueryWrapper);
|
|
|
|
|
|
|
|
if(user == null) {
|
|
|
|
|
|
|
|
return new Result<>(404, "用户不存在", "");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Message message = SendMessageUtil.sendMessage(sendMessageDTO);
|
|
|
|
Message message = SendMessageUtil.sendMessage(sendMessageDTO);
|
|
|
|
messageService.save(message);
|
|
|
|
messageService.save(message);
|
|
|
|
return new Result<>(200, "发送成功", "");
|
|
|
|
return new Result<>(200, "发送成功", "");
|
|
|
|