package com.xcong.excoin.modules.otc.controller;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.xcong.excoin.common.response.Result;
|
import com.xcong.excoin.modules.otc.dto.*;
|
import com.xcong.excoin.modules.otc.service.OtcMsgService;
|
import com.xcong.excoin.modules.otc.vo.ChatBoxVo;
|
import com.xcong.excoin.modules.otc.vo.ChatOrderVo;
|
import com.xcong.excoin.modules.otc.vo.MsgListVo;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiResponse;
|
import io.swagger.annotations.ApiResponses;
|
import lombok.RequiredArgsConstructor;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.validation.annotation.Validated;
|
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;
|
|
@Slf4j
|
@Validated
|
@RestController
|
@RequestMapping(value = "/api/otcMsg")
|
@RequiredArgsConstructor
|
@Api(value = "OtcMsgController", tags = "otc用户消息接口类")
|
public class OtcMsgController {
|
|
private final OtcMsgService otcMsgService;
|
|
/**
|
* 获取对话列表
|
*/
|
@ApiOperation(value = "获取对话列表")
|
@ApiResponses({
|
@ApiResponse(code = 200, message = "success", response = MsgListVo.class)
|
})
|
@PostMapping(value = "/getMsgList")
|
public Result getMsgList(@RequestBody MsgListDto msgListDto) {
|
IPage<MsgListVo> page = otcMsgService.getMsgList(msgListDto);
|
return Result.ok(page.getRecords());
|
}
|
|
/**
|
* 联系卖家或者联系买家
|
*/
|
@ApiOperation(value = "联系卖家或者联系买家")
|
@ApiResponses({
|
@ApiResponse(code = 200, message = "success", response = ChatBoxVo.class)
|
})
|
@PostMapping(value = "/getChatBoxConnect")
|
public Result getChatBoxConnect(@RequestBody ConnectDto connectDto) {
|
return otcMsgService.getChatBoxConnect(connectDto);
|
}
|
|
/**
|
* 进入聊天框,获取聊天记录
|
*/
|
@ApiOperation(value = "进入聊天框,获取聊天记录")
|
@ApiResponses({
|
@ApiResponse(code = 200, message = "success", response = ChatBoxVo.class)
|
})
|
@PostMapping(value = "/getChatBox")
|
public Result getChatBox(@RequestBody ChatBoxDto chatBoxDto) {
|
return otcMsgService.getChatBox(chatBoxDto);
|
}
|
|
/**
|
* 进入聊天框,获取聊天记录---获取未完成记录
|
*/
|
@ApiOperation(value = "进入聊天框---获取未完成记录")
|
@ApiResponses({
|
@ApiResponse(code = 200, message = "success", response = ChatOrderVo.class)
|
})
|
@PostMapping(value = "/getChatOrder")
|
public Result getChatOrder(@RequestBody ChatOrderDto chatOrderDto) {
|
return otcMsgService.getChatOrder(chatOrderDto);
|
}
|
|
/**
|
* 发送消息
|
*/
|
@ApiOperation(value = "发送消息")
|
@PostMapping(value = "/sendMsg")
|
public Result sendMsg(@RequestBody SendMsgDto sendMsgDto) {
|
return otcMsgService.sendMsg(sendMsgDto);
|
}
|
|
|
|
|
}
|