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.ChatBoxDto; import com.xcong.excoin.modules.otc.dto.MsgListDto; import com.xcong.excoin.modules.otc.dto.OrderListDto; import com.xcong.excoin.modules.otc.dto.SendMsgDto; import com.xcong.excoin.modules.otc.service.OtcMsgService; import com.xcong.excoin.modules.otc.vo.ChatBoxVo; import com.xcong.excoin.modules.otc.vo.MsgListVo; import com.xcong.excoin.modules.otc.vo.OrderListVo; 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 page = otcMsgService.getMsgList(msgListDto); return Result.ok(page.getRecords()); } /** * 进入聊天框,获取聊天记录 */ @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 = "发送消息") @PostMapping(value = "/sendMsg") public Result sendMsg(@RequestBody SendMsgDto sendMsgDto) { return otcMsgService.sendMsg(sendMsgDto); } }