Helius
2022-03-09 38179780b2f728abe6dd0e5aaa284c6ee6aa8380
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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);
    }
 
 
 
 
}