|
|
@ -7,7 +7,9 @@ import jty.expressdistributionsystem.DTO.ExpressListDTO;
|
|
|
|
import jty.expressdistributionsystem.DTO.SendMessageDTO;
|
|
|
|
import jty.expressdistributionsystem.DTO.SendMessageDTO;
|
|
|
|
import jty.expressdistributionsystem.entity.*;
|
|
|
|
import jty.expressdistributionsystem.entity.*;
|
|
|
|
import jty.expressdistributionsystem.service.*;
|
|
|
|
import jty.expressdistributionsystem.service.*;
|
|
|
|
|
|
|
|
import jty.expressdistributionsystem.utils.GetIdUtil;
|
|
|
|
import jty.expressdistributionsystem.utils.SendMessageUtil;
|
|
|
|
import jty.expressdistributionsystem.utils.SendMessageUtil;
|
|
|
|
|
|
|
|
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.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
@ -82,6 +84,24 @@ public class AdminController {
|
|
|
|
return new Result<>(200, "发送成功", "");
|
|
|
|
return new Result<>(200, "发送成功", "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取正在留言的人的所有聊天记录
|
|
|
|
|
|
|
|
@GetMapping("/allMessage")
|
|
|
|
|
|
|
|
public Result<List<List<Message>>> getAllMessage(@RequestParam Long toId) {
|
|
|
|
|
|
|
|
Long meId = GetIdUtil.getId();
|
|
|
|
|
|
|
|
LambdaQueryWrapper<Message> messageLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
|
|
|
List<List<Message>> list = new ArrayList<>();
|
|
|
|
|
|
|
|
// 先获取自己发给那个人的
|
|
|
|
|
|
|
|
messageLambdaQueryWrapper.eq(Message::getSendUserId, meId)
|
|
|
|
|
|
|
|
.eq(Message::getGetUserId, toId);
|
|
|
|
|
|
|
|
list.add(messageService.list(messageLambdaQueryWrapper));
|
|
|
|
|
|
|
|
// 再获取别人发给自己的
|
|
|
|
|
|
|
|
messageLambdaQueryWrapper.clear();
|
|
|
|
|
|
|
|
messageLambdaQueryWrapper.eq(Message::getGetUserId, meId)
|
|
|
|
|
|
|
|
.eq(Message::getSendUserId, toId);
|
|
|
|
|
|
|
|
list.add(messageService.list(messageLambdaQueryWrapper));
|
|
|
|
|
|
|
|
return new Result<>(200, "", list);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 管理员获取所有快递信息
|
|
|
|
// 管理员获取所有快递信息
|
|
|
|
@GetMapping("/express")
|
|
|
|
@GetMapping("/express")
|
|
|
|
public Result<Page<ExpressListDTO>> getAllExpress(@RequestParam int page, @RequestParam int pageSize) {
|
|
|
|
public Result<Page<ExpressListDTO>> getAllExpress(@RequestParam int page, @RequestParam int pageSize) {
|
|
|
|