|
|
|
@ -1,16 +1,19 @@
|
|
|
|
|
package com.supervision.police.controller;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.supervision.common.domain.R;
|
|
|
|
|
import com.supervision.police.service.ChatService;
|
|
|
|
|
import com.supervision.police.vo.ChatReqVO;
|
|
|
|
|
import com.supervision.police.vo.ChatResVO;
|
|
|
|
|
import com.supervision.police.vo.ConversationResVo;
|
|
|
|
|
import com.supervision.utils.UserUtil;
|
|
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
|
@RestController
|
|
|
|
@ -27,4 +30,34 @@ public class ChatController {
|
|
|
|
|
return R.ok(chatResVO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询用户会话列表
|
|
|
|
|
* @param pageNum
|
|
|
|
|
* @param pageSize
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/conversation/list")
|
|
|
|
|
public R<IPage<ConversationResVo>> queryUserConversationList(@RequestParam(defaultValue = "1") @Parameter(name = "pageNum",description = "页码") Integer pageNum,
|
|
|
|
|
@RequestParam(defaultValue = "10") @Parameter(name = "pageSize",description = "每页数量") Integer pageSize){
|
|
|
|
|
|
|
|
|
|
IPage<ConversationResVo> conversationResVoIPage = chatService.queryUserConversationList(UserUtil.getUser().getId(),pageNum, pageSize);
|
|
|
|
|
|
|
|
|
|
return R.ok(conversationResVoIPage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/conversation/infoList")
|
|
|
|
|
public R<IPage<ChatResVO>> queryConversationInfoList(@RequestParam String conversationId,
|
|
|
|
|
@RequestParam(defaultValue = "1") @Parameter(name = "pageNum",description = "页码") Integer pageNum,
|
|
|
|
|
@RequestParam(defaultValue = "10") @Parameter(name = "pageSize",description = "每页数量") Integer pageSize){
|
|
|
|
|
|
|
|
|
|
IPage<ChatResVO> chatResVOIPage = chatService.queryConversationInfoList(conversationId, pageNum, pageSize);
|
|
|
|
|
|
|
|
|
|
return R.ok(chatResVOIPage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("/conversation/delete")
|
|
|
|
|
public R<Boolean> deleteConversation(@RequestBody List<String> conversationIdList) {
|
|
|
|
|
chatService.deleteConversation(conversationIdList);
|
|
|
|
|
return R.ok(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|