Class ChatHistoryController

java.lang.Object
io.github.seenings.chat.controller.ChatHistoryController
All Implemented Interfaces:
io.github.seenings.chat.http.HttpChatHistoryService

@RestController public class ChatHistoryController extends Object implements io.github.seenings.chat.http.HttpChatHistoryService
ChatHistoryController
Since:
2022-10-16
Author:
chixuehui
  • Constructor Details

    • ChatHistoryController

      public ChatHistoryController()
  • Method Details

    • add

      public Integer add(io.github.seenings.article.enumeration.ContentType contentType, Integer contentId, Long fromUserId, Long toUserId, Boolean sent, @DateTimeFormat(iso=DATE_TIME) LocalDateTime sendTime)
      Specified by:
      add in interface io.github.seenings.chat.http.HttpChatHistoryService
    • pageUserIdToHistoryId

      public List<Integer> pageUserIdToHistoryId(@RequestParam("pageUserId") Long pageUserId, @RequestParam("selfUserId") Long selfUserId)
      根据页面用户ID和自己的用户ID获取聊天记录ID
      Specified by:
      pageUserIdToHistoryId in interface io.github.seenings.chat.http.HttpChatHistoryService
      Parameters:
      pageUserId - 页面用户ID
      selfUserId - 自己用户ID
      Returns:
      聊天记录ID
    • idToChatContentAndTime

      public Map<Integer, io.github.seenings.chat.model.ChatContentAndTime> idToChatContentAndTime(@RequestBody Set<Integer> ids)
      根据ID获取聊天内容和时间
      Specified by:
      idToChatContentAndTime in interface io.github.seenings.chat.http.HttpChatHistoryService
      Parameters:
      ids - 聊天记录ID
      Returns:
      聊天记录ID对应聊天内容和时间
    • userIdToChatContentAndTime

      public Map<Long, io.github.seenings.chat.model.ChatContentAndTime> userIdToChatContentAndTime(@RequestBody Set<Long> userIds, @RequestParam("toUserId") Long toUserId)
      Specified by:
      userIdToChatContentAndTime in interface io.github.seenings.chat.http.HttpChatHistoryService
    • setSent

      public boolean setSent(@RequestParam("id") Integer id)
      Specified by:
      setSent in interface io.github.seenings.chat.http.HttpChatHistoryService
    • idToFromUserId

      public Map<Integer,Long> idToFromUserId(@RequestBody Set<Integer> ids)
      根据聊天记录ID获取发送方ID
      Specified by:
      idToFromUserId in interface io.github.seenings.chat.http.HttpChatHistoryService
      Parameters:
      ids - 聊天记录ID
      Returns:
      聊天记录ID对应发送方ID
    • idToIsSent

      public Map<Integer,Boolean> idToIsSent(@RequestBody Set<Integer> ids)
      根据聊天记录ID获取是否发出
      Specified by:
      idToIsSent in interface io.github.seenings.chat.http.HttpChatHistoryService
      Parameters:
      ids - 聊天记录ID
      Returns:
      聊天记录ID对应是否发出
    • idToToUserId

      public Map<Integer,Long> idToToUserId(@RequestBody Set<Integer> ids)
      根据聊天记录ID获取接收方ID
      Specified by:
      idToToUserId in interface io.github.seenings.chat.http.HttpChatHistoryService
      Parameters:
      ids - 聊天记录ID
      Returns:
      聊天记录ID对应接收方ID