Class TwoChatSseController

java.lang.Object
io.github.seenings.chat.controller.TwoChatSseController

@RestController @RequestMapping("/seen/sse-v1/chat/two-chat") public class TwoChatSseController extends Object
一对一
  • Field Details

  • Constructor Details

    • TwoChatSseController

      public TwoChatSseController()
  • Method Details

    • send

      @PostMapping("send") public boolean send(@SessionAttribute Long userId, @RequestBody Integer historyId)
      发送消息
      Parameters:
      userId - 用户
      historyId - 历史ID
      Returns:
      是否发送成功
    • receive

      @GetMapping(value="receive", produces="text/event-stream") public org.springframework.web.servlet.mvc.method.annotation.SseEmitter receive(@SessionAttribute Long userId)
      接收消息
      Parameters:
      userId - 用户
      Returns:
      返回sse