|
|
@ -12,6 +12,7 @@ import jty.expressdistributionsystem.utils.SendMessageUtil;
|
|
|
|
import jty.expressdistributionsystem.utils.ThreadLocalUtil;
|
|
|
|
import jty.expressdistributionsystem.utils.ThreadLocalUtil;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
@ -78,7 +79,7 @@ public class AdminController {
|
|
|
|
|
|
|
|
|
|
|
|
// 管理员发送消息
|
|
|
|
// 管理员发送消息
|
|
|
|
@PostMapping("/sendMessage")
|
|
|
|
@PostMapping("/sendMessage")
|
|
|
|
public Result<String> sendMessage(@RequestBody @NotNull SendMessageDTO sendMessageDTO) {
|
|
|
|
public Result<String> sendMessage(@RequestBody @Validated SendMessageDTO sendMessageDTO) {
|
|
|
|
Message message = SendMessageUtil.sendMessage(sendMessageDTO);
|
|
|
|
Message message = SendMessageUtil.sendMessage(sendMessageDTO);
|
|
|
|
messageService.save(message);
|
|
|
|
messageService.save(message);
|
|
|
|
return new Result<>(200, "发送成功", "");
|
|
|
|
return new Result<>(200, "发送成功", "");
|
|
|
|