|
|
|
@ -77,12 +77,6 @@ public class AdminController {
|
|
|
|
|
// 管理员发送消息
|
|
|
|
|
@PostMapping("/sendMessage")
|
|
|
|
|
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);
|
|
|
|
|
messageService.save(message);
|
|
|
|
|
return new Result<>(200, "发送成功", "");
|
|
|
|
|