package com.keao.edu.im.controller;

import com.keao.edu.im.service.ChatroomService;
import io.rong.models.chatroom.ChatroomModel;
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;

/**
 * Created by weiqinxiao on 2019/2/25.
 */
@RestController
@RequestMapping("/keepAlive")
public class KeepAliveController{

    @Autowired
    ChatroomService chatroomService;

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    public Object add(@RequestBody ChatroomModel chatroomModel) throws Exception {
        return chatroomService.keepAliveAdd(chatroomModel);
    }

    @RequestMapping(value = "/remove", method = RequestMethod.POST)
    public Object remove(@RequestBody ChatroomModel chatroomModel) throws Exception {
        return chatroomService.keepAliveRemove(chatroomModel);
    }

    @RequestMapping(value = "/getList", method = RequestMethod.POST)
    public Object getList() throws Exception {
        return chatroomService.keepAliveGetList();
    }
}
