package com.ruoyi.project.common.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.common.dto.MessageChatDto;
import com.ruoyi.project.common.service.IMessageChatService;
import org.apache.commons.math3.analysis.function.Abs;
import org.aspectj.apache.bcel.generic.RET;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 聊天室Controller
 *
 * @author jubs
 * @date 2024-05-14
 */
@RestController
@RequestMapping("/common/messageChat")
public class MessageChatController extends BaseController {
    @Resource
    private IMessageChatService messageChatService;


    @PostMapping("/readMessage")
    public AjaxResult readMessage(@RequestBody MessageChatDto messageChatDto) {
        messageChatService.readMessage(messageChatDto);
        return AjaxResult.success();
    }

    @GetMapping("/getChatRoomByQuery")
    public AjaxResult getChatRoomByQuery(MessageChatDto messageChatDto) {
        return AjaxResult.success(messageChatService.getChatRoomByQuery(messageChatDto));
    }




}
