From 6c2e9ba62c418185361179e7014862c481f34e17 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Wed, 09 Mar 2022 14:22:09 +0800 Subject: [PATCH] conflect merge --- src/main/java/com/xcong/excoin/modules/otc/controller/OtcMsgController.java | 93 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 93 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/xcong/excoin/modules/otc/controller/OtcMsgController.java b/src/main/java/com/xcong/excoin/modules/otc/controller/OtcMsgController.java new file mode 100644 index 0000000..c6bde94 --- /dev/null +++ b/src/main/java/com/xcong/excoin/modules/otc/controller/OtcMsgController.java @@ -0,0 +1,93 @@ +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); + } + + + + +} -- Gitblit v1.9.1