package com.keao.edu.im.controller;

import io.rong.models.conversation.ConversationModel;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.keao.edu.common.controller.BaseController;
import com.keao.edu.im.service.GroupService;

/**
 * Created by weiqinxiao on 2019/2/25.
 */
@RestController
@RequestMapping("/conversation")
public class ConversationController extends BaseController {

    @Autowired
    GroupService groupService;

    @RequestMapping(value = "/mute", method = RequestMethod.POST)
    public Object mute(@RequestBody ConversationModel conversationModel) throws Exception {
        return succeed(groupService.conversationMute(conversationModel));
    }

    @RequestMapping(value = "/unmute", method = RequestMethod.POST)
    public Object unmute(@RequestBody ConversationModel conversationModel) throws Exception {
        return succeed(groupService.conversationUnmute(conversationModel));
    }

    @RequestMapping(value = "/get", method = RequestMethod.POST)
    public Object get(@RequestBody ConversationModel conversationModel) throws Exception {
        return succeed(groupService.conversationGet(conversationModel));
    }
}
